fix(fetchers): better handling for infinite network_idle
This commit is contained in:
@@ -105,7 +105,7 @@ class SyncSession:
|
|||||||
"""Wait for the page to become idle (no network activity) even if there are never-ending requests."""
|
"""Wait for the page to become idle (no network activity) even if there are never-ending requests."""
|
||||||
try:
|
try:
|
||||||
page.wait_for_load_state("networkidle", timeout=timeout)
|
page.wait_for_load_state("networkidle", timeout=timeout)
|
||||||
except PlaywrightError:
|
except (PlaywrightError, Exception):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def _wait_for_page_stability(self, page: Page | Frame, load_dom: bool, network_idle: bool):
|
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."""
|
"""Wait for the page to become idle (no network activity) even if there are never-ending requests."""
|
||||||
try:
|
try:
|
||||||
await page.wait_for_load_state("networkidle", timeout=timeout)
|
await page.wait_for_load_state("networkidle", timeout=timeout)
|
||||||
except PlaywrightError:
|
except (PlaywrightError, Exception):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
async def _wait_for_page_stability(self, page: AsyncPage | AsyncFrame, load_dom: bool, network_idle: bool):
|
async def _wait_for_page_stability(self, page: AsyncPage | AsyncFrame, load_dom: bool, network_idle: bool):
|
||||||
|
|||||||
Reference in New Issue
Block a user