无法使用HTTPS代理获取请求

发布于 2025-02-10 11:22:46 字数 1207 浏览 1 评论 0原文

您好,所以我试图使用代理来获取某些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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

小清晰的声音 2025-02-17 11:22:46

在实施之前,我建议您通过卷发检查所有代理
像这样

curl -v -L "https://2ip.ru/" -x "https://205.207.100.81:8282"

Before implementation I'd suggest you check all proxies by curl
like this

curl -v -L "https://2ip.ru/" -x "https://205.207.100.81:8282"
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文