无法使用HTTPS代理获取请求
您好,所以我试图使用代理来获取某些HTTPS页面的请求,但是它给了我一个错误。
我尝试了 http://free-proxy.cz/en/proxylist/proxylist/proxylist/country/all/https/https/https/ping/ping/all 其他免费代理列表 但是它们都没有起作用(只有http)
import requests
proxies = [
{
"https" : "207.236.12.76:10458"
}
]
url = "https://api.ipify.org?format=json"
for proxy in proxies:
resp = requests.get(url, proxies=proxy)
print(resp.text)
给了我这一点:
raise SSLError(e, request=request)
requests.exceptions.SSLError: HTTPSConnectionPool(host='api.ipify.org', port=443): Max retries exceeded with url: /?format=json (Caused by SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1129)')))
我尝试添加{“ https”的https时
raise ProxyError(e, request=request)
requests.exceptions.ProxyError: HTTPSConnectionPool(host='api.ipify.org', port=443): Max retries exceeded with url: /?format=json (Caused by ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 403 Forbidden')))
当 工作?
Hello, so I am trying to get requests to some https page using proxies, but it gives me an error.
I tried couple of proxies from http://free-proxy.cz/en/proxylist/country/all/https/ping/all and other free proxy lists
but none of them works (only http)
import requests
proxies = [
{
"https" : "207.236.12.76:10458"
}
]
url = "https://api.ipify.org?format=json"
for proxy in proxies:
resp = requests.get(url, proxies=proxy)
print(resp.text)
This gives me this:
raise SSLError(e, request=request)
requests.exceptions.SSLError: HTTPSConnectionPool(host='api.ipify.org', port=443): Max retries exceeded with url: /?format=json (Caused by SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1129)')))
When i tried adding https like {"https" : "https://207.236.12.76:10458" }:
raise ProxyError(e, request=request)
requests.exceptions.ProxyError: HTTPSConnectionPool(host='api.ipify.org', port=443): Max retries exceeded with url: /?format=json (Caused by ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 403 Forbidden')))
Am I doing something wrong or the proxies just doesn't work?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在实施之前,我建议您通过卷发检查所有代理
像这样
Before implementation I'd suggest you check all proxies by curl
like this