I'm a little bit confused about this situation. I'm working on a script to login into a website. I'm using CookieJar and the login method is working just fine.
If I try to display the cookieJar content:
for index, cookie in enumerate(cw.cj):
print index, ':', cookie
I get a cookie as:
0 : <Cookie C4CSESSID=tqb2qn92du8i9k5r4vnpd83i73 for www.example.com/>
But in my Firefox if I'm looking for that domain (in fact, w/out www) in the cookies editor, I can see also the google analytics ones (__utma, __utmc, etc).
How can I capture this cookies also in cj? My goal is to be able to modify __utmb cookie content. (I can do it from FF but I want from the script also)
Thanks
I think you get that cookie once the tracking code on that page has executed (in the response from the Google server). As it's javascript, you'll need to find a way to either interpret Javascript in your code, or mimic the request the tracking code issues.
Interpreting Javascript out of the context of a browser could prove tricky, I suspect that the tracking code needs access to the DOM, which it probably doesn't have if you get the page with urllib for example.