以编程方式通过Python代理发出HTTP请求 [英] Programmatically make HTTP requests through proxies with Python
本文介绍了以编程方式通过Python代理发出HTTP请求的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何使用Python通过代理发出HTTP请求?
How do I use Python to make an HTTP request through a proxy?
我需要对以下代码做什么?
What do I need to do to the following code?
urllib.urlopen('http://www.google.com')
推荐答案
urlopen
函数支持代理。试试这样的事情:
The urlopen
function supports proxies. Try something like this:
urllib.urlopen(your_url, proxies = {"http" : "http://192.168.0.1:80"})
这篇关于以编程方式通过Python代理发出HTTP请求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文