Skip to content

Commit 9c039fb

Browse files
committed
fix: remove redundant DOM content loaded event handling logic
1 parent 9ea9e91 commit 9c039fb

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

pydoll/browser/page.py

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -354,17 +354,6 @@ async def _wait_page_load(self, timeout: int = 300):
354354
page_events_auto_enabled = True
355355
await self.enable_page_events()
356356

357-
dom_loaded = asyncio.Event()
358-
await self.on(
359-
PageEvents.DOM_CONTENT_LOADED,
360-
lambda _: dom_loaded.set(),
361-
temporary=True,
362-
)
363-
try:
364-
await asyncio.wait_for(dom_loaded.wait(), timeout=timeout)
365-
except asyncio.TimeoutError:
366-
pass
367-
368357
page_loaded = asyncio.Event()
369358
await self.on(
370359
PageEvents.PAGE_LOADED,
@@ -373,7 +362,7 @@ async def _wait_page_load(self, timeout: int = 300):
373362
)
374363

375364
try:
376-
await asyncio.wait_for(page_loaded.wait(), timeout=5)
365+
await asyncio.wait_for(page_loaded.wait(), timeout=timeout)
377366
except asyncio.TimeoutError:
378367
pass
379368

0 commit comments

Comments
 (0)