-
Notifications
You must be signed in to change notification settings - Fork 371
Session closed error when script is delayed more than 20 seconds #175
Comments
Looks like it's related to websockets,
And somehow PS: Possible solutions:
|
Good job! async def scroll_page(page):
cur_dist = 0
height = await page.evaluate("() => document.body.scrollHeight")
while True:
if cur_dist < height:
await page.evaluate("window.scrollBy(0, 500);")
await asyncio.sleep(0.1)
cur_dist += 500
else:
break and the top solution seems works for me, but it doesn't solve the problem at all. |
For those who want to hack before the patch arrives.
|
Do I understand correctly, that this issue is not solved, and monkeypatching is required now? |
@uhbif19 it looks like this project is abandoned by the core developer, so you can use any solution provided above, the easiest way is to dropdown websockets to the |
@uhbif19 Get it, thanks. |
When a script is delayed, the pyppeteer failed with the following error:
Session closed. Most likely the page has been closed.
Here is a simple example how to reproduce it:
Protocol Error (Runtime.callFunctionOn): Session closed. Most likely the page has been closed.
PS: On my machine, with a 19 seconds delay this script works ok, but with 20 and more - fails.
The text was updated successfully, but these errors were encountered: