Re: [Tutor] Using urllib to retrieve info

2005-08-09 Thread David Holland
I had a look at urllib2 and I found this example :- import urllib2 # Create an OpenerDirector with support for Basic HTTP Authentication... auth_handler = urllib2.HTTPBasicAuthHandler() auth_handler.add_password('realm', 'host', 'username', 'password') opener = urllib2.build_opener(auth_handler) #

Re: [Tutor] Using urllib to retrieve info

2005-08-09 Thread Kent Johnson
David Holland wrote: > Alan, > > Sorry of course that is the problem. These pages are > password protected > Is it possible to download password protected pages (I > know the password but I don't how to get the program > to use it). urllib2 supports basic and digest authentication. There a

Re: [Tutor] Using urllib to retrieve info

2005-08-09 Thread Alan G
> Sorry of course that is the problem. These pages are > password protected > Is it possible to download password protected pages (I > know the password but I don't how to get the program > to use it). That will depend on how the protection is implemented. If your server is a J2EE box with

Re: [Tutor] Using urllib to retrieve info

2005-08-09 Thread David Holland
Alan, Sorry of course that is the problem. These pages are password protected Is it possible to download password protected pages (I know the password but I don't how to get the program to use it). David --- Alan G <[EMAIL PROTECTED]> wrote: > > It runs fine but the file saved to disk is

Re: [Tutor] Using urllib to retrieve info

2005-08-08 Thread Liam Clarke-Hutchinson
age- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Alan G Sent: Tuesday, 9 August 2005 6:33 a.m. To: David Holland; tutor python Subject: Re: [Tutor] Using urllib to retrieve info > It runs fine but the file saved to disk is the > information at : 'http://support.myw

Re: [Tutor] Using urllib to retrieve info

2005-08-08 Thread Alan G
> It runs fine but the file saved to disk is the > information at : 'http://support.mywork.co.uk' > not > 'http://support.mywork.co.uk/index.php?node=2371&pagetree=&fromid=20397&objectid=21897";' Could there be cookies involved? Just a thought, Alan G. _

Re: [Tutor] Using urllib to retrieve info

2005-08-08 Thread Kent Johnson
David Holland wrote: > Kent, > > Sorry I should have put my code. > This is what I wrote > import urllib > import urllib2 > f = > urllib.urlopen("http://support.mywork.co.uk/index.php?node=2371&pagetree=&fromid=20397&objectid=21897";).read() > newfile = open("newfile.html",'w') > newfile.write(f)