Update screenshot_downloader.py
Scrolls comment into view. Without, it can break
This commit is contained in:
1 parent
637e4c66f2
commit
07beeafa50
1 file changed
+2
@@ -230,6 +230,8 @@ def get_screenshots_of_reddit_posts(reddit_object: dict, screenshot_num: int):
|
||||
zoom = settings.config["settings"]["zoom"]
|
||||
# zoom the body of the page
|
||||
page.evaluate("document.body.style.zoom="+str(zoom))
|
||||
# scroll comment into view
|
||||
page.locator(f"#t1_{comment['comment_id']}").scroll_into_view_if_needed()
|
||||
# as zooming the body doesn't change the properties of the divs, we need to adjust for the zoom
|
||||
location = page.locator(f"#t1_{comment['comment_id']}").bounding_box()
|
||||
for i in location:
|
||||
|
||||
Reference in new issue
Block a user