Taking screenshot of a webpage with Python-Selenium. How it can be done?

0 votes
May 27 in Selenium by Babita
37 views

1 answer to this question.

0 votes

Hi Babita, try using this piece of code to take screenshot of a webpage with Selenium-Python:

from selenium import webdriver

options = webdriver.ChromeOptions()
options.add_argument('--ignore-certificate-errors')
options.add_argument("--test-type")
driver = webdriver.Chrome("C:\\\\Users\\\\Abha_Rathour\\\\Downloads\\\\ExtractedFiles\\\\chromedriver_win32\\\\chromedriver.exe" ,chrome_options=options)

driver.get('https://python.org')
driver.save_screenshot("screenshot.png")

driver.close(
answered May 27 by Abha
• 19,130 points

Related Questions In Selenium

0 votes
1 answer

How can I capture screenshot of a webpage partially in Selenium?

Hey Tejasvi, you can capture screenshot of ...READ MORE

answered Jul 8 in Selenium by Anvi
• 11,690 points
40 views
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

Installing Selenium Webdriver with Python package

Hey Hemant, for installing Selenium Webdriver with ...READ MORE

answered May 8 in Selenium by Anvi
• 11,690 points
108 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,050 points
403 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
760 views
0 votes
1 answer
0 votes
1 answer

How to capture screenshot of a webpage using Selenium Webdriver?

Hi Bindiya, you can use TakesScreenshot interface to capture the ...READ MORE

answered Jul 8 in Selenium by Abha
• 19,130 points
33 views