urllib.urlopen and proxies

Paul Moore paul.moore at uk.origin-it.com
Mon Mar 5 10:26:18 EST 2001


On Mon, 5 Mar 2001 15:03:35 +0100 , "Chris Gonnerman"
<chris.gonnerman at usa.net> wrote:

>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.

Doesn't work for me... I attach an example, in case there are any
pointers in the result.

Paul

--- Example session ---

>>> from urllib import urlopen
>>> print urlopen("http://UUUU:PPPP@www.python.org/").read()
<HTML><HEAD>
<TITLE>ERROR: Proxy Access Denied, authentication failed</TITLE>
<!-- $Id: ERR_CACHE_ACCESS_DENIED,v 1.1 2000/12/20 12:11:12 devet Exp
$ -->
</HEAD>
<BODY BGCOLOR="#ffffff">
<H1>ERROR</H1>
<H2>Proxy Access Denied, authentication failed</H2>
<HR>
<P>
While trying to retrieve the URL:
<A HREF="http://www.python.org/">http://www.python.org/</A>
<P>
The following error was encountered:
<UL>
<LI>
<STRONG>
Proxy Access Denied, authentication failed.
</STRONG>
</UL>
</P>

<P>Sorry, you are currently not allowed to request:
<PRE>    http://www.python.org/</PRE>
from this proxy until you have authenticated yourself.
</P>

<P>Please use your NT userid <B>without the "domain\" part</B> and
your
NT password. <B>Example</B>: "cc01234" (not "europe\cc01234"!) and
"zekret!". </P>

<P>

See the <A
HREF="http://channels.origin-it.com/newsbin/center/fulltext.asp?msgId=NE20001207
110741C111083">
announcement</A> on Channels for further information.

<P>
You need to use Netscape version 2.0 or greater, or Microsoft Internet
Explorer 3.0, or an HTTP/1.1 compliant browser for this to work.
Please
contact the the helpdesk if you have difficulties authenticating
yourself.
</P>

<br clear="all">
<hr noshade size=1>
Generated Mon, 05 Mar 2001 15:20:35 GMT by www-proxy2.nl.origin-it.com
(<a href=
"http://squid.nlanr.net/Squid/">Squid/2.2.STABLE4</a>)
</BODY></HTML>




More information about the Python-list mailing list