[2.5.1/cookielib] How to display specific cookie?

G

Gilles Ganault

Hello

I'm using ActivePython 2.5.1 and the cookielib package to retrieve web
pages.

I'd like to display a given cookie from the cookiejar instead of the
whole thing:

========
#OK
for index, cookie in enumerate(cj):
print index, ' : ', cookie

#How to display just PHPSESSID?
#AttributeError: CookieJar instance has no attribute '__getitem__'
print "PHPSESSID: %s" % cj['PHPSESSID']
========

I'm sure it's very simple but googling for this didn't return samples.

Thank you.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,060
Latest member
BuyKetozenseACV

Latest Threads

Top