[Tutor] Cookies and authorization

2005-06-23 Thread D. Hartley
Hello, everyone! I am trying to go to a website, collect any and all cookies I receive by going to that website, and then look at the cookies/print them. So I did the following, from the cookie examples in the documentation: import cookielib, urllib2 myjar = cookielib.CookieJar() opener =

Re: [Tutor] Cookies and authorization

2005-06-23 Thread Kent Johnson
D. Hartley wrote: My problem is, when I plug this url into my sample code above, I get an error (HTTP Error 401: Authorization Required), because normally when you go to this url it makes you enter in a username and a password. (Also, there is lots of documentation on the cookie modules,

Re: [Tutor] Cookies and authorization

2005-06-23 Thread Christian Wyglendowski
-Original Message- Christian, Try subclassing urllib.FancyURLopener and overriding the prompt_user_passwd() method. That should get you what you need :-) Well, I used urllib.FancyURLopener, and can open and look at the url, like this: import urllib opener2 =

[Tutor] Cookies and authorization - urllib2 vs urllib

2005-06-23 Thread D. Hartley
From Christian: Try subclassing urllib.FancyURLopener and overriding the prompt_user_passwd() method. That should get you what you need :-) Well, I used urllib.FancyURLopener, and can open and look at the url, like this: import urllib opener2 = urllib.FancyURLopener({}) f =