<div class="gmail_quote">On Tue, Oct 19, 2010 at 1:56 PM, Tim Johnson <span dir="ltr">&lt;<a href="mailto:tim@johnsons-web.com">tim@johnsons-web.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

I&#39;ve written the following function which successfully gets an<br>
authenticated URL:<br>
def getRestrictedURL(authName,URL,log,pswd):<br>
        auth_handler = urllib2.HTTPBasicAuthHandler()<br>
        auth_handler.add_password(authName, URL,log,pswd)<br>
        opener = urllib2.build_opener(auth_handler)<br>
        urllib2.install_opener(opener)<br>
        return opener.open(URL).read()<br>
# But, alas, any links in content &#39;beneath&#39; the URL<br>
# require additional authentication.<br>
Any way around this?<br>
Thanks<br>
<font color="#888888">--<br>
Tim<br>
tim at <a href="http://johnsons-web.com" target="_blank">johnsons-web.com</a> or <a href="http://akwebsoft.com" target="_blank">akwebsoft.com</a><br>
<a href="http://www.akwebsoft.com" target="_blank">http://www.akwebsoft.com</a><br>
_______________________________________________<br>
Tutor maillist  -  <a href="mailto:Tutor@python.org">Tutor@python.org</a><br>
To unsubscribe or change subscription options:<br>
<a href="http://mail.python.org/mailman/listinfo/tutor" target="_blank">http://mail.python.org/mailman/listinfo/tutor</a><br>
</font></blockquote></div><br>Tim,<div><br><div>Unless you are tied to the standard library I would recommend looking at</div><div><br></div><div>httplib2  <a href="http://code.google.com/p/httplib2/">http://code.google.com/p/httplib2/</a></div>

<div><br></div><div>This handles your authentication and connection much better then the standard urllib.<br clear="all"><br>-- <br>Vince Spicer<div><br></div><div><span style="font-family:arial, sans-serif;font-size:13px;border-collapse:collapse">-- </span></div>

<div><span style="font-family:arial, sans-serif;font-size:13px;border-collapse:collapse">Sent from Ubuntu</span></div><br>
</div></div>