From 32b8c93ced48ce2433c471f9fbc131945f05ea95 Mon Sep 17 00:00:00 2001 From: RiveN <61630074+RiveN000@users.noreply.github.com> Date: Thu, 14 Jul 2022 18:46:11 +0200 Subject: [PATCH] Fix: Hide the "Click to see NSFW" button The page locator couldn't find the "Click to see NSFW" button. It was still visible on screenshots. After changing it to look for text (innerHTML), instead, it worked. --- 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 6fb9ef4..995e304 100644 --- a/video_creation/screenshot_downloader.py +++ b/video_creation/screenshot_downloader.py @@ -50,7 +50,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.locator( - '[data-click-id="text"] button' + 'text=Click to see nsfw' ).click() # Remove "Click to see nsfw" Button in Screenshot # translate code