![](/img/trans.png)
[英]SSL: CERTIFICATE_VERIFY_FAILED certificate verify failed in Python
[英]SSL: CERTIFICATE_VERIFY_FAILED certificate verify failed - Google Colab
我正在尝试使用 beautifulsoup 从 url 中抓取数据。 下面是我的代码
import requests
URL = "https://bigdataldn.com/speakers/"
page = requests.get(URL)
print(page.text)
但是,当我在 google colab 中运行代码时出现以下错误。
SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1091)
During handling of the above exception, another exception occurred:
MaxRetryError Traceback (most recent call last)
MaxRetryError: HTTPSConnectionPool(host='bigdataldn.com', port=443): Max retries exceeded with url: / (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1091)')))
上面的代码适用于其他网址。 有人可以帮我弄清楚如何解决这个问题。
这不是你的错——他们的证书链没有正确配置。 您可以做的是禁用证书验证(在处理敏感信息时不应该这样做!)但对于网络爬虫来说可能没问题。
page = requests.get(URL, verify=False)
您的 SSL 证书安装不正确,您可以按照 godaddy ssl 安装说明进行操作,可能会有所帮助。 https://in.godaddy.com/help/install-my-ssl-certificate-16623?sp_hp=B&xpmst=A&xpcarveout=B
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.