From 34aff6eeadf565e8f5030bf9269ac6f49edf257b Mon Sep 17 00:00:00 2001 From: Roostydoo2 <56526202+Roostydoo2@users.noreply.github.com> Date: Mon, 4 Nov 2024 13:03:29 +1300 Subject: [PATCH] Update screenshot_downloader.py Fixes unable to zoom bug --- video_creation/screenshot_downloader.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/video_creation/screenshot_downloader.py b/video_creation/screenshot_downloader.py index 753a328..a80009c 100644 --- a/video_creation/screenshot_downloader.py +++ b/video_creation/screenshot_downloader.py @@ -177,7 +177,7 @@ def get_screenshots_of_reddit_posts(reddit_object: dict, screenshot_num: int): # zoom the body of the page page.evaluate("document.body.style.zoom=" + str(zoom)) # as zooming the body doesn't change the properties of the divs, we need to adjust for the zoom - location = page.locator('[data-test-id="post-content"]').bounding_box() + location = page.locator('h1[slot="title"]').bounding_box() for i in location: location[i] = float("{:.2f}".format(location[i] * zoom)) page.screenshot(clip=location, path=postcontentpath)