简体   繁体   English

在给定 OpenSSL.SSL.Error 'SSL 例程'、'tls_process_server_certificate'、'证书验证失败的情况下,通过 requests-html 获取 JavaScript Web

[英]Get JavaScript Web by requests-html given OpenSSL.SSL.Error'SSL routines', 'tls_process_server_certificate', 'certificate verify failed

I'm following this guide of requests-html library and found this error in my laptop.我正在遵循这个requests-html指南,并在我的笔记本电脑中发现了这个错误。

In JavaScript Support I try to code like this page:在 JavaScript 支持中,我尝试像这个页面一样编码:

from requests_html import HTMLSession
session = HTMLSession()
r = session.get('http://python-requests.org/')
r.html.render()
print(r.text)

When ran this code I received this content in Sublimetext:运行此代码时,我在 Sublimetext 中收到了此内容:

[W:pyppeteer.chromium_downloader] start chromium download. [W:pyppeteer.chromium_downloader] 开始下载chrome。 Download may take a few minutes.下载可能需要几分钟。 OpenSSL.SSL.Error: [('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')] OpenSSL.SSL.Error: [('SSL 例程', 'tls_process_server_certificate', '证书验证失败')]

Can anyone fix this problem for me, please?任何人都可以为我解决这个问题吗?

I solve problem with :我用以下方法解决问题:

pip install pyppdf

then in the code first use:然后在代码中首先使用:

import pyppdf.patch_pyppeteer

Source : https://github.com/miyakogi/pyppeteer/issues/258#issuecomment-563075764来源: https : //github.com/miyakogi/pyppeteer/issues/258#issuecomment-563075764

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM