Is it possible to take screenshot of only viewable area of a webpage using Python Selenium?

0 votes
Is it possible to take screenshot of only viewable area of a webpage using Python Selenium?
Jul 29 in Selenium by Gulzar
30 views

1 answer to this question.

0 votes

Hi Gulzar, to understand how capturing of viewable area of a webpage works, checkout following automation script:

from selenium import webdriver

options = webdriver.ChromeOptions()
options.add_argument('--ignore-certificate-errors')
options.add_argument("--test-type")
options.binary_location = "/usr/bin/chromium"
driver = webdriver.Chrome(chrome_options=options)

driver.get('https://amazon.in')
driver.save_screenshot("screenshot.png")

driver.close()

answered Jul 29 by Anvi
• 12,840 points

Related Questions In Selenium

+1 vote
2 answers
0 votes
2 answers
0 votes
1 answer

Is it possible to manually set the attribute value of a Web Element using Selenium?

Yes, its very much possible. You just ...READ MORE

answered May 8, 2018 in Selenium by king_kenny
• 3,650 points
5,579 views
0 votes
1 answer

Finding WebDriver element with Class Name in java

The better way to handle this element ...READ MORE

answered Apr 10, 2018 in Selenium by nsv999
• 5,090 points
559 views
0 votes
1 answer
0 votes
1 answer

Geo-location microphone camera pop up

To Allow or Block the notification, access using Selenium and you have to ...READ MORE

answered May 11, 2018 in Selenium by Samarpit
• 5,130 points
892 views
0 votes
1 answer

How to use such xpath to find web elements

It's much simpler to use: #MyDiv123 > div.super or ...READ MORE

answered Jun 14, 2018 in Selenium by Samarpit
• 5,130 points
558 views
0 votes
1 answer
0 votes
1 answer