解决pyppeteer Session closed. Most likely the page has been closed.问题

 在python左侧菜单栏的底部可以看到我们当前项目所用的python解释器,找到site-packages这个文件夹,这个文件夹中是我们python解释器所安装的第三方模块

解决pyppeteer Session closed. Most likely the page has been closed.问题_第1张图片

 然后在site-packages文件夹中找到pyppeteer模块,模块中有一个connection.py文件,打开这个文件

解决pyppeteer Session closed. Most likely the page has been closed.问题_第2张图片

 修改这个文件的第44行代码为第45行代码,其实就是添加了两个参数,应该跟timeout有关,类似于requests的timeout参数

self ._url,max_size = Noneloop = self ._loop ping_interval = None ping_timeout = None   如下图所示:

然后再运行我们写的pyppeteer程序,发现问题已经解决了。

解决pyppeteer Session closed. Most likely the page has been closed.问题_第3张图片

 

你可能感兴趣的:(解决pyppeteer Session closed. Most likely the page has been closed.问题)