SSL:CERTIFICATE_VERIFY_FAILED 证书验证失败 - Google Colab
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)')))
以上代码适用于其他 url。
谁能帮我弄清楚如何解决这个问题。
enter image description here
您的 SSL 证书没有正确安装,您可以按照 godaddy ssl 安装说明进行操作,也许会有帮助。
https://in.godaddy.com/help/install-my-ssl-certificate-16623?sp_hp=B&xpmst=A&xpcarveout=B
这不是你的错 - 他们的证书链配置不正确。您可以做的是禁用证书验证(当您处理敏感信息时不应该这样做!)但是对于网络爬虫来说可能没问题。
page = requests.get(URL, verify=False)
我正在尝试使用 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)')))
以上代码适用于其他 url。 谁能帮我弄清楚如何解决这个问题。
enter image description here
您的 SSL 证书没有正确安装,您可以按照 godaddy ssl 安装说明进行操作,也许会有帮助。 https://in.godaddy.com/help/install-my-ssl-certificate-16623?sp_hp=B&xpmst=A&xpcarveout=B
这不是你的错 - 他们的证书链配置不正确。您可以做的是禁用证书验证(当您处理敏感信息时不应该这样做!)但是对于网络爬虫来说可能没问题。
page = requests.get(URL, verify=False)