Thank you for your answer. I still have some questions. I can successfully request the data using the local IP address, but I get an error using the HTTPS proxy IP address. What causes this? Is there a solution
I found an HTTPS proxy to request, but I could not access it(the access without proxy was successful, and I also tested that the proxy IP was available). Please help me to find out the cause. What's the solution? Thank you very much.
#! /usr/bin/python
# coding=utf-8
import requests
import time
# 请求地址
targetUrl = "https://ip.900cha.com/"
# #代理服务器
proxyHost = "180.113.64.100"
proxyPort = 40055
#非账号密码验证
proxyMeta = "https://%(host)s:%(port)s" % {
"host": proxyHost,
"port": proxyPort,
}
proxies = {
"https": proxyMeta
}
resp = requests.get(targetUrl, proxies=proxies,timeout=10)
print(resp.text)
The error message is as follows:
requests.exceptions.SSLError: HTTPSConnectionPool(host='ip.900cha.com', port=443): Max retries exceeded with url: /(Caused by SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol(_ssl.c:1131)')))
0 Answer
Thank you for your answer. I still have some questions. I can successfully request the data using the local IP address, but I get an error using the HTTPS proxy IP address. What causes this? Is there a solution
Request original address https://ip.900cha.com/%EF%BC%8C%E9%80%9A%E8%BF%87%E6%B5%8F%E8%A7%88%E5%99%A8F12%E6%8A%93%E5%8C%85% E5 E4 AF 8 f % % % % % BB A5 E7% % 9 E5 8 b c % % % 87% BA EF E8 BC 8 c % % % % % BF % 98% % 99% % E6 AFhttp2.0 E7%9 a % 84% B1 E6 B7 AF E8% % % % % 82 < / span > < / a >
< div class = "aw - list - img >
If it helps, please click to accept ~
这家伙很懒,什么都没留下...