From 213770e173969cac09a38daf1ff53d071c720b66 Mon Sep 17 00:00:00 2001 From: Drugsosos <44712637+Drugsosos@users.noreply.github.com> Date: Sat, 23 Jul 2022 22:24:01 +0300 Subject: [PATCH] fix for Navigation TimeoutError --- webdriver/playwright.py | 10 ++++++++-- webdriver/pyppeteer.py | 10 ++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/webdriver/playwright.py b/webdriver/playwright.py index 30ea32c..8cd8fec 100644 --- a/webdriver/playwright.py +++ b/webdriver/playwright.py @@ -213,7 +213,10 @@ class RedditScreenshot(Flaky, Browser): filename_idx: index for the filename """ comment_page = await self.context.new_page() - await comment_page.goto(f'https://reddit.com{comment_obj["comment_url"]}') + await comment_page.goto( + f'https://reddit.com{comment_obj["comment_url"]}', + timeout=0, # Fix for Navigation TimeoutError + ) # Translates submission' comment if self.post_lang: @@ -272,7 +275,10 @@ class RedditScreenshot(Flaky, Browser): # Get the thread screenshot reddit_main = await self.context.new_page() - await reddit_main.goto(self.reddit_object["thread_url"]) # noqa + await reddit_main.goto( # noqa + self.reddit_object["thread_url"], + timeout=0, # Fix for Navigation TimeoutError + ) if settings.config["settings"]["theme"] == "dark": await self.__dark_theme(reddit_main) diff --git a/webdriver/pyppeteer.py b/webdriver/pyppeteer.py index d38c3a3..0f4e162 100644 --- a/webdriver/pyppeteer.py +++ b/webdriver/pyppeteer.py @@ -252,7 +252,10 @@ class RedditScreenshot(Browser, Wait): filename_idx: index for the filename """ comment_page = await self.browser.newPage() - await comment_page.goto(f'https://reddit.com{comment_obj["comment_url"]}') + await comment_page.goto( + f'https://reddit.com{comment_obj["comment_url"]}', + timeout=0, # Fix for Navigation TimeoutError + ) # Translates submission' comment if self.post_lang: @@ -311,7 +314,10 @@ class RedditScreenshot(Browser, Wait): # Get the thread screenshot reddit_main = await self.browser.newPage() - await reddit_main.goto(self.reddit_object["thread_url"]) # noqa + await reddit_main.goto( # noqa + self.reddit_object["thread_url"], + timeout=0, # Fix for Navigation TimeoutError + ) if settings.config["settings"]["theme"] == "dark": await self.__dark_theme(reddit_main)