1. 报错1:Most likely the page has been closed
pyppeteer.errors.NetworkError: Protocol Error (Runtime.callFunctionOn): Session closed. Most likely the page has been closed.
使用pyppeteer采集京东的时候,总数到7~8页的时候就报错.
谷歌发现了这样的解决方案:
https://github.com/miyakogi/pyppeteer/issues/178
https://github.com/miyakogi/pyppeteer/pull/160/files
照着修改了一下源码,就解决了这个问题,在此记录一下.
2. 报错2:error while loading shared libraries: libX11-xcb.so.1
在ubuntu16.04
上,使用python3.6
运行pyppeteer
的demo
:
import asyncio
from pyppeteer import launch
async def main():
browser = await launch()
page = await browser.newPage()
await page.goto('http://example.com')
await page.screenshot({'path': 'e