[英]HTTPS using a proxy server with requests python 3.x
我想要使用代理的請求,但出現以下錯誤。
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')))
我嘗試將 urlib3 的版本降級到 1.25.3,即使我嘗試了如下代理設置,同樣的錯誤仍然發生。
proxies = [{
'http' : 'http://ip:port',
'https' : 'http://ip:port'
}]
&&&&&
proxies = [{
'http' : 'http://ip:port',
'https' : 'https://ip:port'
}]
錯誤值也被賦予了驗證選項,但錯誤繼續發生。 你能告訴我解決方案嗎?
搜索的時候聽說我的代理ip不支持https通信。 這是正確的嗎?
proxies = {
'http': 'http://user_name:password@ip:port',
'https': 'http://user_name:password@ip:port'
}
r = requests.get(URL, proxies=proxies)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.