Programmatically make HTTP requests through a proxy using Python

How to use Python to create an HTTP request through a proxy?

What do I need to do for the following code?

urllib.urlopen('http://www.google.com') 
+4
source share
2 answers

The urlopen function supports proxies. Try something like this:

 urllib.urlopen(your_url, proxies = {"http" : "http://192.168.0.1:80"}) 
+6
source

You can see PycURL . I use cURL a lot in PHP and I like it. Although there is probably an easy way to do this now in Python.

+1
source

All Articles