refactor: headless

pull/1288/head
Syed Aman Raza 2 years ago committed by GitHub
parent 3f6344aca3
commit c6f7295948
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -26,7 +26,7 @@ def download_screenshots_of_reddit_posts(reddit_object: dict, screenshot_num: in
with sync_playwright() as p: with sync_playwright() as p:
print_substep("Launching Headless Browser...") print_substep("Launching Headless Browser...")
browser = p.chromium.launch(headless=True) # add headless=False for debug browser = p.chromium.launch() # add headless=False for debug
context = browser.new_context() context = browser.new_context()
@ -69,7 +69,7 @@ def download_screenshots_of_reddit_posts(reddit_object: dict, screenshot_num: in
postcontentpath = f"assets/temp/{id}/png/title.png" postcontentpath = f"assets/temp/{id}/png/title.png"
page.locator('[data-test-id="post-content"]').screenshot(path=postcontentpath) page.locator('[data-test-id="post-content"]').screenshot(path=postcontentpath)
if settings.config["settings"]["storymode"] == True: if settings.config["settings"]["storymode"] :
if settings.config["settings"]["storymodemethod"] == 0: if settings.config["settings"]["storymodemethod"] == 0:
try : #new change try : #new change
page.locator('[data-click-id="text"]').first.screenshot( page.locator('[data-click-id="text"]').first.screenshot(

Loading…
Cancel
Save