我不能在 Python 中使用不同的代理。
我的代码:
import requests
proxies = {
"https":'https://154.16.202.22:3128',
"http":'http://154.16.202.22:3128'
}
r=requests.get('https://httpbin.org/ip', proxies=proxies)
print(r.json())
Run Code Online (Sandbox Code Playgroud)
我得到的错误是:
.
.
.
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='httpbin.org', port=443): Max retries exceeded with url: /ip (Caused by SSLError(SSLError(1, '[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1122)')))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
.
.
.
requests.exceptions.SSLError: HTTPSConnectionPool(host='httpbin.org', port=443): Max retries exceeded with url: /ip (Caused by SSLError(SSLError(1, '[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1122)')))
Run Code Online (Sandbox Code Playgroud)
我执行了pip …