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 the

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 full

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 ale

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)

[Tutor] Using urllib to retrieve info

2005-08-08 Thread David Holland
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=2371pagetree=fromid=20397objectid=21897;).read() newfile = open(newfile.html,'w') newfile.write(f) newfile.close() print 'finished' It runs fine

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=2371pagetree=fromid=20397objectid=21897;).read() newfile = open(newfile.html,'w') newfile.write(f) newfile.close()

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=2371pagetree=fromid=20397objectid=21897;' Could there be cookies involved? Just a thought, Alan G. ___

Re: [Tutor] Using urllib to retrieve info

2005-08-08 Thread Liam Clarke-Hutchinson
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.mywork.co.uk' not 'http://support.mywork.co.uk/index.php?node=2371pagetree=fromid=2039 7objectid=21897' Could