Reputation: 11
I want requests using proxy, but the following errors occur.
requests.exceptions.ProxyError: HTTPSConnectionPool(host='URL', port=443): Max retries exceeded with url: / (Caused by ProxyError('Cannot connect to proxy.', FileNotFoundError(2, 'No such file or directory')))
I tried downgrading the version of urlib3 to 1.25.3, and the same error continues to occur even though I tried the proxy setting as below.
proxies = [{
'http' : 'http://ip:port',
'https' : 'http://ip:port'
}]
&&&&&
proxies = [{
'http' : 'http://ip:port',
'https' : 'https://ip:port'
}]
False value is also given to the verify option, but errors continue to occur. Can you tell me the solution?
When I searched, I heard that my proxy ip does not support https communication. Is this right?
Upvotes: 1
Views: 615
Reputation: 61
proxies = {
'http': 'http://user_name:password@ip:port',
'https': 'http://user_name:password@ip:port'
}
r = requests.get(URL, proxies=proxies)
Upvotes: 1