I am trying to save a screenshot from a website using Selenium
with Python 3.6 (on Windows 10). When I use the get_screenshot_as_file()
or get_screenshot_as_png()
functions, I always get the following exception:
WebDriverException: unknown error: cannot get automation extension from unknown error: page could not be found: chrome-extension://aapnijgdinlhnhlmodcfapnahmbfebeb/_generated_background_page.html
(Session info: chrome=60.0.3112.90)
(Driver info: chromedriver=2.25.426923 (0390b88869384d6eb0d5d09729679f934aab9eed),platform=Windows NT 6.1.7601 SP1 x86_64)
For example:
driver = webdriver.Chrome()
ref = 'http://google.com'
driver.get(ref)
driver.get_screenshot_as_png()
Is there a workaround, or another way to save the entire page as an image?