diff --git a/changedetectionio/content_fetcher.py b/changedetectionio/content_fetcher.py index f4b16cbb..89e93ca7 100644 --- a/changedetectionio/content_fetcher.py +++ b/changedetectionio/content_fetcher.py @@ -281,7 +281,7 @@ class base_html_playwright(Fetcher): from playwright.sync_api import sync_playwright import playwright._impl._api_types from playwright._impl._api_types import Error, TimeoutError - + response = None with sync_playwright() as p: browser_type = getattr(p, self.browser_type) @@ -329,7 +329,6 @@ class base_html_playwright(Fetcher): context.close() browser.close() print ("response object was none") - print (str(e)) raise EmptyReply(url=url, status_code=None) # Bug 2(?) Set the viewport size AFTER loading the page @@ -343,8 +342,8 @@ class base_html_playwright(Fetcher): context.close() browser.close() print ("Content was empty") - print (str(e)) raise EmptyReply(url=url, status_code=None) + self.headers = response.all_headers() if current_css_filter is not None: diff --git a/changedetectionio/update_worker.py b/changedetectionio/update_worker.py index 6e9fab0d..138a5435 100644 --- a/changedetectionio/update_worker.py +++ b/changedetectionio/update_worker.py @@ -63,11 +63,11 @@ class update_worker(threading.Thread): pass except content_fetcher.EmptyReply as e: # Some kind of custom to-str handler in the exception handler that does this? - err_text = "EmptyReply: Status Code {}".format(e.status_code) + err_text = "EmptyReply - try increasing 'Wait seconds before extracting text', Status Code {}".format(e.status_code) self.datastore.update_watch(uuid=uuid, update_obj={'last_error': err_text, 'last_check_status': e.status_code}) except content_fetcher.ScreenshotUnavailable as e: - err_text = "Screenshot unavailable, page did not render fully in the expected time" + err_text = "Screenshot unavailable, page did not render fully in the expected time - try increasing 'Wait seconds before extracting text'" self.datastore.update_watch(uuid=uuid, update_obj={'last_error': err_text, 'last_check_status': e.status_code}) except content_fetcher.PageUnloadable as e: