簡體   English   中英

使用帶有請求的代理服務器的 HTTPS python 3.x

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM