无法通过代理python3进行请求

问题描述 投票:0回答:1

我正在尝试使用代理进行请求,但我不知道我为什么


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行,在send中 引发ProxyError(e,request = request)requests.exceptions.ProxyError:HTTPConnectionPool(host ='114.99.11.114',端口= 3000):url超过了最大重试次数:http://httpbin.org/ip(由ProxyError('无法连接到代理服务器。',NewConnectionError(':未能建立)新的连接:[Errno 110]连接超时',)))]

我不知道为什么会错误地导致代理无法正常工作,但是我更改了很多代理以寻求帮助

还有一个扣留项,在我更改代理并且更改它并且我的代码看起来像li时添加

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”}

甚至代理都是匿名的

python python-3.x proxy python-requests
1个回答
0
投票
print(requests.get("http://httpbin.org/ip",proxies={"http":"http://118.69.50.154:80"}).text)

为我工作并产生了:

{
    "origin": "210.245.110.254"  
}

这绝对不是我的IP。

© www.soinside.com 2019 - 2024. All rights reserved.