fix(fetchers): better handling for infinite network_idle

This commit is contained in:
Karim shoair
2025-12-03 03:11:30 +02:00
parent 16ff07a287
commit aed34e43b5
+2 -2
View File
@@ -105,7 +105,7 @@ class SyncSession:
"""Wait for the page to become idle (no network activity) even if there are never-ending requests."""
try:
page.wait_for_load_state("networkidle", timeout=timeout)
except PlaywrightError:
except (PlaywrightError, Exception):
pass
def _wait_for_page_stability(self, page: Page | Frame, load_dom: bool, network_idle: bool):
@@ -221,7 +221,7 @@ class AsyncSession:
"""Wait for the page to become idle (no network activity) even if there are never-ending requests."""
try:
await page.wait_for_load_state("networkidle", timeout=timeout)
except PlaywrightError:
except (PlaywrightError, Exception):
pass
async def _wait_for_page_stability(self, page: AsyncPage | AsyncFrame, load_dom: bool, network_idle: bool):