我正在尝试使用代理进行请求,但我不知道为什么
loadproxy = {
"https":"114.99.11.114:3000",
"http":"114.99.11.114:3000",
}
url = "http://httpbin.org/ip"
res = requests.get(url,proxies=loadproxy)
print(res.text)
发送文件“ /usr/lib/python3/dist-packages/requests/adapters.py”,第502行 引发ProxyError(e,request = request) requests.exceptions.ProxyError:HTTPConnectionPool(host ='114.99.11.114',port = 3000):url:http://httpbin.org/ip超过了最大重试次数(由ProxyError('无法连接到代理服务器。',NewConnectionError(':失败)引起建立新的连接:[Errno 110]连接超时',)))
我不知道为什么错误代理无法正常工作,但是我已经更改了很多代理来寻求帮助
在我更改代理并且更改了代理并且我的代码看起来还不错的情况下,还需要保留一个
loadproxy = {
"https":"118.69.50.154:80",
"http":"118.69.50.154:80",
}
url = "http://httpbin.org/ip"
res = requests.get(url,proxies=loadproxy)
print(res.text)
但是这里的问题是它显示了我的原始IP
{ “ origin”:“ my_ip” }
甚至代理都是匿名的
答案 0 :(得分:0)
print(requests.get("http://httpbin.org/ip",proxies={"http":"http://118.69.50.154:80"}).text)
为我工作并产生了:
{
"origin": "210.245.110.254"
}
这绝对不是我的IP。