Python 官方文档:入门教程 => 点击学习
# -*- coding: utf-8 -*-import requestsheaders = {'user-agent': 'Mozilla/5.0 (windows NT 10.0; Win64; x64) AppleWEBKit/53
# -*- coding: utf-8 -*-import requestsheaders = {'user-agent': 'Mozilla/5.0 (windows NT 10.0; Win64; x64) AppleWEBKit/537.36 (Khtml, like Gecko) Chrome/105.0.0.0 Safari/537.36'}proxy = {"Http": "http://122.230.151.87:35920", "https": "https://122.230.151.87:35920"}url = 'https://www.qcc.com'response = requests.get(url, proxies=proxy, headers=headers)print(response.text)
报错如下:
requests.exceptions.SSLError: HTTPSConnectionPool(host='www.qcc.com', port=443): Max retries exceeded with url: / (Caused by SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1131)')))
有两种解决方法:
降低urllib3的版本 <= 1.25.11
pip install urllib3==1.25.11
https:// > http://
daili
{"http": "http://122.230.151.87:35920", "https": "https://122.230.151.87:35920"}
改为:
{"http": "http://122.230.151.87:35920", "https": "http://122.230.151.87:35920"}
来源地址:https://blog.csdn.net/whn18723613485/article/details/128190119
--结束END--
本文标题: python 关于Caused by SSLError(SSLEOFError(8, ‘EOF occurred in violation of protocol (_ssl.c:1131)‘)
本文链接: https://lsjlt.com/news/405913.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
2024-03-01
2024-03-01
2024-03-01
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0