pyppeteer.errors.NetworkError: Protocol error (Runtime.releaseObject): Cannot find context with spec

This problem seems to be surprisingly few online records, or is it facing Google to find clues, or is an article from a domestic boss really can’t help but spit on Baidu’s domestic articles. Baidu can’t find people in the life and death of people. Search engines abroad can see the color of your underwear. Up

 

Okay, let’s get back to business, thanks to this big guy’s tips  https://blog.csdn.net/qq_33850304/article/details/103042138

Although his method does not work on my side, he mentioned that the reason may be because pyppeteer's operations are all concurrent, which causes the previous request page to be rolled back before it is loaded, which leads to an error:

pyppeteer.errors.NetworkError: Protocol error (Runtime.evaluate): Cannot find context with specified id

This error statement is not unique, anyway, the next JS statement is an error.

 

My solution here is to increase the delay

  

Attach a screenshot of the article to prevent the link to the article from being invalid

Guess you like

Origin blog.csdn.net/weixin_41822224/article/details/106386818