|
|
@ -75,7 +75,7 @@ def get_screenshots_of_reddit_posts(reddit_object: dict, screenshot_num: int):
|
|
|
|
print_substep("Launching Headless Browser...")
|
|
|
|
print_substep("Launching Headless Browser...")
|
|
|
|
|
|
|
|
|
|
|
|
browser = p.chromium.launch(
|
|
|
|
browser = p.chromium.launch(
|
|
|
|
headless=True
|
|
|
|
headless=False
|
|
|
|
) # headless=False will show the browser for debugging purposes
|
|
|
|
) # headless=False will show the browser for debugging purposes
|
|
|
|
# Device scale factor (or dsf for short) allows us to increase the resolution of the screenshots
|
|
|
|
# Device scale factor (or dsf for short) allows us to increase the resolution of the screenshots
|
|
|
|
# When the dsf is 1, the width of the screenshot is 600 pixels
|
|
|
|
# When the dsf is 1, the width of the screenshot is 600 pixels
|
|
|
@ -220,7 +220,7 @@ def get_screenshots_of_reddit_posts(reddit_object: dict, screenshot_num: int):
|
|
|
|
if page.locator('[data-testid="content-gate"]').is_visible():
|
|
|
|
if page.locator('[data-testid="content-gate"]').is_visible():
|
|
|
|
page.locator('[data-testid="content-gate"] button').click()
|
|
|
|
page.locator('[data-testid="content-gate"] button').click()
|
|
|
|
|
|
|
|
|
|
|
|
page.goto(f'https://reddit.com{comment["comment_url"]}', timeout=0)
|
|
|
|
page.goto(f'https://new.reddit.com/{comment["comment_url"]}', timeout=0)
|
|
|
|
|
|
|
|
|
|
|
|
# translate code
|
|
|
|
# translate code
|
|
|
|
|
|
|
|
|
|
|
|