- 本人系统:macOS10.14.6 Mojave
- 场景:使用Python requests 包+ip代理池爬取网站数据
- 报错:requests.exceptions.SSLError: HTTPSConnectionPool(host='xxxxx', port=443): Max retries exceeded with url: / (Caused by SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1124)')))
原代码是这样的:
import requests
proxies = {"http": "http://127.0.0.1:10080",
"https": "https://127.0.0.1:10080"}
print(requests.get('https://www.google.com/', proxies=proxies, verify=False).text)
报错如下:
不使用代理时,可以直接获取到内容,一使用代理就报错。
首先需要确认自己的的IP地址是否可行。确认后没问题,继续还是如上错误
我直接拿报错信息,拿去网上搜各种说法。
最终功夫不负有心人,看到有人在传入proxy给proxies的时候,
将