以编程方式通过Python代理发出HTTP请求

hek*_*ran 4 python proxy http

如何使用Python通过代理发出HTTP请求?

我需要对以下代码做什么?

urllib.urlopen('http://www.google.com')
Run Code Online (Sandbox Code Playgroud)

And*_*are 6

urlopen功能支持代理.尝试这样的事情:

urllib.urlopen(your_url, proxies = {"http" : "http://192.168.0.1:80"})
Run Code Online (Sandbox Code Playgroud)