Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/350.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python请求代理无法正常工作_Python_Proxy_Python Requests - Fatal编程技术网

Python请求代理无法正常工作

Python请求代理无法正常工作,python,proxy,python-requests,Python,Proxy,Python Requests,我尝试通过很多代理(私人和公共)进行连接,但它们不起作用。 谁能帮我找出问题? 您还可以使用自己的代理来测试我的代码 代码: import requests proxy = {'http' : 'http://35.207.183.125:3133'} print(requests.get("https://httpbin.org/ip", proxies=proxy).text) 您需要为http和https定义代理:proxy={'http':'http://35.

我尝试通过很多代理(私人和公共)进行连接,但它们不起作用。
谁能帮我找出问题?

您还可以使用自己的代理来测试我的代码

代码:

import requests

proxy = {'http' : 'http://35.207.183.125:3133'}
print(requests.get("https://httpbin.org/ip", proxies=proxy).text)

您需要为http和https定义代理:
proxy={'http':'http://35.207.183.125:3133','https':'http://35.207.183.125:3133“}