urllib.urlopen and proxies

Chris Gonnerman chris.gonnerman at usa.net
Mon Mar 5 09:03:35 EST 2001


It *appears* (from reading the source) that username and password
information for
the proxy server must be passed as part of the URL:

    http://username:password@my.host.com/index.html

for instance.  I haven't tested this yet.  The source for urllib is a bit
dense
IMHO but the answers are in there.

----- Original Message -----
From: "Paul Moore" <gustav at morpheus.demon.co.uk>
Newsgroups: comp.lang.python
To: <python-list at python.org>
Sent: Sunday, March 04, 2001 7:44 AM
Subject: urllib.urlopen and proxies


> I've just looked at urllib for the first time. I was pleased to find
> that it automatically picks up my proxy configuration from the system
> (this is ActiveState's Python 2.0 on Windows 2000). However, I have a
> problem - my proxy requires a user name and password, and there is no
> place that I can see to enter them. So all I get back from urlopen()
> is the polite "you need authorisation" message that our proxy gives
> :-(
>
> Can anyone tell me how to pass a proxy userid and password to
> urllib.urlopen()?
>
> Thanks,
> Paul Moore
> --
> http://mail.python.org/mailman/listinfo/python-list
>





More information about the Python-list mailing list