From 545ec8e40c3f2b75e27c2abe01df23604b2a4763 Mon Sep 17 00:00:00 2001 From: dgtlmoon Date: Thu, 26 Mar 2026 19:24:00 +0100 Subject: [PATCH] Fetcher fix --- changedetectionio/content_fetchers/puppeteer.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/changedetectionio/content_fetchers/puppeteer.py b/changedetectionio/content_fetchers/puppeteer.py index d6eeea02b..bb2eb8f61 100644 --- a/changedetectionio/content_fetchers/puppeteer.py +++ b/changedetectionio/content_fetchers/puppeteer.py @@ -441,8 +441,12 @@ class fetcher(Fetcher): if self.status_code != 200 and not ignore_status_codes: screenshot = await capture_full_page(page=self.page, screenshot_format=self.screenshot_format, watch_uuid=watch_uuid, lock_viewport_elements=self.lock_viewport_elements) - - raise Non200ErrorCodeReceived(url=url, status_code=self.status_code, screenshot=screenshot) + try: + page_html = await self.page.content() + except Exception as e: + logger.warning(f"Got non-200 status {self.status_code} but failed to fetch page content: {e}") + page_html = None + raise Non200ErrorCodeReceived(url=url, status_code=self.status_code, screenshot=screenshot, page_html=page_html) content = await self.page.content