1

So, currently I found some help at this link: https://stackoverflow.com/a/51517606/13605508

However, once my python script takes a picture of the element, when I go and check it out, it is just a blank screen. However, the image is as long as the element is. The element goes off the screen and is super long and skinny, that is how I can tell it is at least picking up the proper element dimensions. Additionally, I am running my Chrome (or was at least) on a browser zoom of 20% so I could try to capture the element as much as possible. When I take the zoom off, the element screenshot is still blank, however it will be the wrong size as well.

I would really like to fix this method I am currently using considering it seems to be the easiest way. However if there is no solution to this, is there another work around? I have tried everything in my power in order to capture the whole element (which again, goes off the screen, while headless not being an option). Also, I would like to extend my gratitude ahead of time to thank anyone who takes the time out of their day to help me solve this.

'element = driver.find_element_by_css_selector("div.answers-wrap")
driver.execute_script("arguments[0].scrollIntoView();", element)
image = driver.find_element_by_css_selector("div.answers-wrap").screenshot_as_png
img = Image.open(io.BytesIO(image))
img.save("image.png")
time.sleep(3)
driver.quit()'

0 Answers0