Skip to content
This repository has been archived by the owner on May 8, 2020. It is now read-only.

pyppeteer.errors.NetworkError: Protocol Error: Cannot find context with specified id None #63

Open
csugzq opened this issue Apr 12, 2018 · 5 comments

Comments

@csugzq
Copy link

csugzq commented Apr 12, 2018

The error happens frequently when I visit a websit using pyppeteer, is it a bug from puppeteer. I saw some people are discussing this issue.
puppeteer/puppeteer#1325

@miyakogi
Copy link
Owner

Thank you for information.
I will check the puppeteer's issue.

@keithhackbarth
Copy link

keithhackbarth commented May 13, 2018

Btw.. according to puppeteers documentation this occurs when the page is not fully loaded.

Here's how I fix in my code, basically a recursive retry loop

 async def _evaluate(page, retries=0):
    if retries > 10:
        return await page.evaluate('document.body.innerHTML')
     else:
        try:
            return await page.evaluate('document.body.innerHTML')
        except pyppeteer.errors.NetworkError:
             await asyncio.sleep(0.5)
             return await _evaluate(page, retries+1)

@immerrr
Copy link

immerrr commented Jul 14, 2018

FTR puppeteer/puppeteer#1325 was closed in June

@civanescu
Copy link

I have the same error each time I try to open a page on godaddy. But it appears almost instantly how can it be "page not fully loaded" ?

Thanks

@ytldsimage
Copy link

It seems nothing changed.

ERROR:root:Execution context was destroyed, most likely because of a navigation. Traceback (most recent call last): File "/Users/ytldsimage/anaconda3/lib/python3.7/site-packages/pyppeteer/execution_context.py", line 106, in evaluateHandle 'userGesture': True, pyppeteer.errors.NetworkError: Protocol error (Runtime.callFunctionOn): Cannot find context with specified id

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants