can httplib.HTTPConnection use proxy?

robert no-spam at no-spam-no-spam.com
Fri Mar 17 06:46:59 EST 2006


JuHui wrote:

> sorry, would you please give a sample code?
> I want to use HTTPConnection to get a html page content via a http
> proxy.
> thanks.
> 

-> adam

and maybe you just want plain GET/POST.  use urllib

 >>> url='http://www.google.ca'
 >>> urllib.FancyURLopener(proxies={'http':'http://vs:3128'}).open( url 
).read()
'<html><head><meta http-equiv="content-type" content="text/html; 
charset=ISO-8859-1"><title>Google</title><style><!--\nbody,td,a,p,.h{font-family:arial,sans-serif;}\n.h{font-size: 
20px....



Robert





More information about the Python-list mailing list