[Centos7+docker running error] When using pyppeteer to report the following error pyppeteer.errors.BrowserError: Browser closed unexpectedly

Reference: https://blog.csdn.net/qq_26870933/article/details/101288399

 

the reason:

pyppeteer needs to be run without sandbox arg [I am running on docker, for this you must use the --no-sandbox parameter ]

Solution:

Find our custom middlewares in middlewares.py, and find the getbrowser method, change self.browser = await pyppeteer.launch() to self.browser = await pyppeteer.launch( options={'args': ['-- no-sandbox'] }) problem can be solved

 

Guess you like

Origin blog.csdn.net/weixin_43343144/article/details/109116801