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?
-
It probably just means that the proxies are deadCharchit Agarwal– Charchit Agarwal2022年06月24日 19:02:13 +00:00Commented Jun 24, 2022 at 19:02
-
Yea, you are right.jiw– jiw2022年06月24日 19:35:26 +00:00Commented Jun 24, 2022 at 19:35
1 Answer 1
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"
answered Jun 28, 2022 at 11:30
Konstantin Bronnikov
111 bronze badge
Sign up to request clarification or add additional context in comments.
1 Comment
Community
As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.
lang-py