代理服务器没有';t使用Python请求更改公共IP

代理服务器没有';t使用Python请求更改公共IP,python,proxy,python-requests,Python,Proxy,Python Requests,我正在运行以下脚本: import requests proxyDict = {"http" : 'http://81.93.73.28:8081'} r = requests.get('http://ipinfo.io/ip', proxies=proxyDict) r.status_code r.headers['content-type'] r.encoding print(r.text) 我尝试了自己的代理服务器和几个公共服务器。它仍然打印我当前的ip。

我正在运行以下脚本:

import requests

proxyDict = {"http"  : 'http://81.93.73.28:8081'}

r = requests.get('http://ipinfo.io/ip', proxies=proxyDict)
r.status_code
r.headers['content-type']

r.encoding

print(r.text)
我尝试了自己的代理服务器和几个公共服务器。它仍然打印我当前的ip。
我做错了什么?

代理似乎有问题。我尝试了随机的,免费的一个代码。此外,您的代码还存在一些问题。您正在调用没有使用的属性-它们是不需要的。试着用那个代码和代理,对我来说,它奏效了

proxyDict = {"http"  : 'http://162.14.18.11:80'}

r = requests.get('http://ipinfo.io/ip', proxies=proxyDict, )
print(r.status_code)

print(r.text)

这回答了你的问题吗?不,我的剧本是基于这些答案的。因为某种原因,它不起作用。可能只是新手的错误,我几乎不知道python@sktvlfw你能接受我的回答吗?