[Python][錯誤]python發送請求訪問https

1.使用python.get訪問https的地址是:會有SSL Error

requests.exceptions.SSLError: HTTPSConnectionPool

解決辦法:在url之後添加verify=False


2.訪問https鏈接會有警告InsecureRequestWarning

xxxx.py:847: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings InsecureRequestWarning)

解決辦法:在代碼前添加一下代碼

import urllib3
from urllib3.exceptions import InsecureRequestWarning
urllib3.disable_warnings(InsecureRequestWarning)

如圖

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章