support to scrape on the chrome error page (#4018)

This commit is contained in:
LawyZheng
2025-11-18 17:12:11 +08:00
committed by GitHub
parent ce76b400a9
commit 5ead565fd8

View File

@@ -791,7 +791,11 @@ class BrowserState:
return [
http_page
for http_page in self.browser_context.pages
if http_page.url == "about:blank" or urlparse(http_page.url).scheme in ["http", "https"]
if (
http_page.url == "about:blank"
or http_page.url == "chrome-error://chromewebdata/"
or urlparse(http_page.url).scheme in ["http", "https"]
)
]
async def validate_browser_context(self, page: Page) -> bool: