From f0e1bdc48a209a712b387c0b8dfef964fdebf663 Mon Sep 17 00:00:00 2001 From: RiveN000 <61630074+RiveN000@users.noreply.github.com> Date: Fri, 15 Jul 2022 12:59:21 +0200 Subject: [PATCH] Fix: Hide the "Click to see NSFW" button Fixed this issue by making Playwright wait for page to fully load before clicking the button. --- video_creation/screenshot_downloader.py | 1 + 1 file changed, 1 insertion(+) diff --git a/video_creation/screenshot_downloader.py b/video_creation/screenshot_downloader.py index 1f28c74..7898e8d 100644 --- a/video_creation/screenshot_downloader.py +++ b/video_creation/screenshot_downloader.py @@ -49,6 +49,7 @@ def download_screenshots_of_reddit_posts(reddit_object: dict, screenshot_num: in print_substep("Post is NSFW. You are spicy...") page.locator('[data-testid="content-gate"] button').click() + page.wait_for_load_state() # Wait for page to fully load if page.locator('[data-click-id="text"] button').is_visible(): page.locator(