0

I am trying to take a screenshot of a website, but it is not developed. Selenium returns me the following message:

selenium.common.exceptions.WebDriverException: 
Message: Reached error page: about:neterror?e=dnsNotFound&u=https%3A//test-test-test-test-test.info/&c=UTF-8&d=We%20can%E2%80%99t%20connect%20to%20the%20server%20at%20test-test-test-test-test.info.

I use the method:

driver.save_screenshot("my_pic.png")

Is there a way, I would get an image, despite DNS is not being found?

filtertips
  • 685
  • 1
  • 9
  • 23
  • 1
    Not Sure what images you are after. However since you are getting exception before capturing the screenshot. Use `try..except` block and capture screenshot in the `except` block using the same code. Hope this will help. – KunduK Dec 10 '20 at 16:22
  • 1
    I don't think this is related to the screenshot at all. I think the error is coming from a driver.get that precedes it. See also https://stackoverflow.com/questions/43812991/selenium-webdriverexception-reached-error-page – DMart Dec 10 '20 at 16:29
  • @KunduK Yes you are correct! – filtertips Dec 10 '20 at 16:45
  • @Dmart Yes, I can't believe how i didn't notice that. – filtertips Dec 10 '20 at 16:46

0 Answers0