Fix: Hide the "Click to see NSFW" button

Fixed this issue by making Playwright wait for page to fully load before clicking the button.
pull/1001/head
RiveN000 2 years ago
parent 45c8401589
commit f0e1bdc48a

@ -49,6 +49,7 @@ def download_screenshots_of_reddit_posts(reddit_object: dict, screenshot_num: in
print_substep("Post is NSFW. You are spicy...") print_substep("Post is NSFW. You are spicy...")
page.locator('[data-testid="content-gate"] button').click() 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(): if page.locator('[data-click-id="text"] button').is_visible():
page.locator( page.locator(

Loading…
Cancel
Save