pyppeteer icon indicating copy to clipboard operation
pyppeteer copied to clipboard

[SEVERE] The communication with Chromium are disconnected after 20 seconds.

Open PCXDME opened this issue 6 years ago • 4 comments

The connection/communication with Chromium are disconnected after 20 seconds. So if you do something after 20 seconds, app will crash.

This will fail.

import asyncio
from pyppeteer import launch

async def main():
    browser = await launch()
    page = await browser.newPage()
    await page.goto('http://example.com')
    await asyncio.sleep(20)
    await page.screenshot({'path': 'example.png'})
    await browser.close()

asyncio.get_event_loop().run_until_complete(main())

Solution: https://github.com/miyakogi/pyppeteer/blob/master/pyppeteer/connection.py#L43 The websockets.client.connect should be called with these parameters. ping_interval=None ping_timeout=None

This is fixed in https://github.com/pyppeteer/pyppeteer2

See https://github.com/miyakogi/pyppeteer/pull/160#issuecomment-616863812

PCXDME avatar Nov 06 '18 00:11 PCXDME

Related to #158 I think

saadtazi avatar Nov 06 '18 03:11 saadtazi

Confirming issue and fix, thanks for that!

wackazong avatar Nov 18 '18 00:11 wackazong

Will this be part of a release?

nurettin avatar Nov 27 '18 08:11 nurettin

Hi,

Is this going to be addressed in future releases?

lucaromagnoli avatar Dec 20 '18 10:12 lucaromagnoli