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)
#
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
> 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
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
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
> 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.
_
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)