Re: Using a proxy with urllib2

2008-01-12 Thread Rob Wolfe
"Jack" <[EMAIL PROTECTED]> writes: >>> I'm trying to use a proxy server with urllib2. >>> So I have managed to get it to work by setting the environment >>> variable: >>> export HTTP_PROXY=127.0.0.1:8081 >>> >>> But I wanted to set it from the code. However, this does not set the >>> proxy: >>>

Re: Using a proxy with urllib2

2008-01-11 Thread Jack
>> I'm trying to use a proxy server with urllib2. >> So I have managed to get it to work by setting the environment >> variable: >> export HTTP_PROXY=127.0.0.1:8081 >> >> But I wanted to set it from the code. However, this does not set the >> proxy: >> httpproxy = '127.0.0.1:3129' >> prox

Re: Using a proxy with urllib2

2008-01-11 Thread Rob Wolfe
"Jack" <[EMAIL PROTECTED]> writes: > Rob, > > I tried your code snippet and it worked great. I'm just wondering if > getopener( ) call > is lightweight so I can just call it in every call to fetchurl( )? Or I > should try to share > the opener object among fetchurl( ) calls? Creating an opener

Re: Using a proxy with urllib2

2008-01-11 Thread Jack
Rob, I tried your code snippet and it worked great. I'm just wondering if getopener( ) call is lightweight so I can just call it in every call to fetchurl( )? Or I should try to share the opener object among fetchurl( ) calls? Thanks, Jack "Rob Wolfe" <[EMAIL PROTECTED]> wrote in message new

Re: Using a proxy with urllib2

2008-01-11 Thread Jack
> Works for me. > How do you know that the proxy is not set? The proxy drops some URLs and the URLs were not being dropped when I did this :) > Try this: Thank you. I'll give it a try. -- http://mail.python.org/mailman/listinfo/python-list

Re: Using a proxy with urllib2

2008-01-10 Thread Rob Wolfe
"Jack" <[EMAIL PROTECTED]> writes: > I'm trying to use a proxy server with urllib2. > So I have managed to get it to work by setting the environment > variable: > export HTTP_PROXY=127.0.0.1:8081 > > But I wanted to set it from the code. However, this does not set the proxy: > httpproxy = '127

Using a proxy with urllib2

2008-01-10 Thread Jack
I'm trying to use a proxy server with urllib2. So I have managed to get it to work by setting the environment variable: export HTTP_PROXY=127.0.0.1:8081 But I wanted to set it from the code. However, this does not set the proxy: httpproxy = '127.0.0.1:3129' proxy_support = urllib2.ProxyHan