1.問題描述:
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='passport.cnblogs.com', port=443): Max retries exceeded with url: /user/signin (Caused by ProxyError('Cannot connect to proxy.', ConnectionResetError(10054, '遠程主機強 迫關閉了一個現有的連接。', None, 10054, None)))
解決方案:
import os
os.environ['NO_PROXY'] = 'stackoverflow.com'
2問題描述:
C:\Python37\lib\site-packages\urllib3\connectionpool.py:1004: 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 requests
from requests.packages.urllib3.exceptions import InsecureRequestWarning
requests.packages.urllib3.disable_warnings(InsecureRequestWarning)