Wednesday, October 08, 2008

urllib2 problems in python

Ever received this error while you were using urllib2. And you use proxies to connect to the internet?


urllib2.URLError: <urlopen error (111, 'Connection refused')>


Set the HTTP_PROXY environment variable and the problem is solved.


npower@The-Matrix~:$export HTTP_PROXY="http://144.16.192.245:8080"


In this case, 144.16.192.245 is the proxy I use, and on port 8080.

blog comments powered by Disqus