[Tutor] Cookielib - CookieJar objects

Liam Clarke cyresse at gmail.com
Wed Jun 29 03:17:30 CEST 2005

Hi Denise, 

Have you tried 'print myjar.value'?


Liam Clarke
On 6/29/05, D. Hartley <denise.hartley at gmail.com> wrote:
> Hi everyone! Just a quick question about cookie jars:
> when I create a myjar = cookielib.CookieJar(), and go to a website to
> get the particular cookie, I get something like this in return:
> <cookielib.CookieJar[Cookie(version=0, name='info', value='B',
> port=None, port_specified=False, domain='.pythonchallenge.com',
> domain_specified=True, domain_initial_dot=True, path='/',
> path_specified=True, secure=False, expires=1120610689, discard=False,
> comment=None, comment_url=None, rest={})]>
> or, if I do print myjar, this: <cookielib.CookieJar[<Cookie info=B
> for .pythonchallenge.com/>]> .
> Now, if I wanted to pull out just the value from the cookie (i.e., "B"
> in this particular case, labelled as "cookie info" in the print
> statement and 'value=' in the cookiejar instance), how could I do
> that?
> I have tried looking through the documentation and its examples, tried
> __doc__ and help() and dir() and can't find it. Perhaps I'm just
> missing something, but does anyone know?
> Thanks!
> ~Denise
> _______________________________________________
> Tutor maillist - Tutor at python.org
> http://mail.python.org/mailman/listinfo/tutor

'There is only one basic human right, and that is to do as you damn well 
And with it comes the only basic human duty, to take the consequences.'
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20050629/14a73193/attachment.htm

More information about the Tutor mailing list