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.