使用requests-html的render方法出错
第一次使用Render方法时,会出现urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host=‘storage.googleapis.com’, port=443): Max retries exceeded with url: /chromium-browser-snapshots/Win/575458/chrome-win32.zip (Caused by SSLError(SSLError(“bad handshake: Error([(‘SSL routines’, ‘tls_process_server_certificate’, ‘certificate verify failed’)])”)))错误提示。
这是因为:调用render 方法启动pyppeteer,pyppeteer需要与浏览器(chromium)进行交互,第一次使用时pyppeteer没有绑定Chromium的话,会从新下载一个Chrome浏览器。
由于其指定的路径被墙,没有科学上网或者SS/SSR之类的,就会出现下载错误从而导致方法中断。
实际上,可以使用系统上原来装有的Chrome,在requests-html源代码
(如C:\Users\XXX\AppData\Local\Programs\Python\Python37-32\Lib\site-packages\requests_html.py)的
第714行:
原句:
self._browser =