0

I am using Python with selenium for some automation. I have a list of URLs that contains images. I desire to take a screenshot and save them. I am using the code below to achieve my goal.

for i in range(0,len(urls)):
    browser.get(urls[i])
    browser.save_screenshot(str(i)+".jpg") # saves screenshot of entire page

The code is saving the pictures but they all have a size of 0 kb and cannot be opened. I have checked this link which basically tells how to take screenshots and couldn't get any solutions for the screenshot getting saved as 0kb.

m0bi5
  • 8,900
  • 7
  • 33
  • 44
  • @xsami note that my code takes the screenshot but it's 0kb only. Taking the screenshot is not a problem here. please read the question then comment – m0bi5 May 28 '17 at 19:20
  • 1
    Note that you may have a different problem than the [duplicate question](https://stackoverflow.com/questions/3422262/take-a-screenshot-with-selenium-webdriver); however the question you ask here does not allow to give you any other answer than you already find in the duplicate. So you may decide to update your question with some reproducible example from which the actual problem becomes apparent. In that case the question could be reopened. – ImportanceOfBeingErnest May 28 '17 at 19:38

0 Answers0