[Tutor] password protection in httplib
Andre Engels
andreengels at gmail.com
Fri Mar 3 17:52:01 CET 2006
Thanks for your answers! It is working now!
2006/3/3, Kent Johnson <kent37 at tds.net>:
> Andre Engels wrote:
> > 2006/3/3, Kent Johnson <kent37 at tds.net>:
> >
> >
> >>Have you tried using a CookieManager as shown in the first example here:
> >>http://docs.python.org/lib/cookielib-examples.html
> >>
> >>Once you set up your opener with a CookieJar the cookies should be
> >>handled automatically - if a server sets a cookie it will be remembered
> >>and returned back to the server on subsequent requests.
> >>
> >>This page has more examples though again IMO they are overly complex:
> >>http://www.voidspace.org.uk/python/articles/cookielib.shtml
> >
> >
> > I had looked at it yes, but I don't know how to combine the two
> > handlers (the one for authentication and the one for cookies). Apart
> > from that I hoped that because the program already has cookie handling
> > programmed in, reusing that code might be less trouble than splitting
> > the authenticated and the non-authenticated case everywhere.
>
> The call to urllib2.build_opener() accepts multiple arguments, just list
> both handlers.
>
> Kent
>
> _______________________________________________
> Tutor maillist - Tutor at python.org
> http://mail.python.org/mailman/listinfo/tutor
>
--
Andre Engels, andreengels at gmail.com
ICQ: 6260644 -- Skype: a_engels
More information about the Tutor
mailing list