From 05ef0c28d836cdc83eed715eca238522f8dcf68f Mon Sep 17 00:00:00 2001 From: jmrkd-studio <108296592+MaheshTheDeveloper@users.noreply.github.com> Date: Mon, 31 Mar 2025 03:04:29 +0530 Subject: [PATCH] Waiting for locator("[data-test-id="post-content"]") --- 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 6b56e99..1bc51fe 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(f'shreddit-post[id="t3_{reddit_id}"]').bounding_box() for i in location: location[i] = float("{:.2f}".format(location[i] * zoom)) page.screenshot(clip=location, path=postcontentpath)