[英]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.