Pass ID and password to the server

L

larryzhang

Hi,

I am trying to grab webpages from a site that requires user ID and
password, is there a way that I can pass my ID and password to the
server? Thanks.

Larry
 
S

Steven D'Aprano

Hi,

I am trying to grab webpages from a site that requires user ID and
password, is there a way that I can pass my ID and password to the
server? Thanks.


It depends on what the server is expecting.

Some *really bad* systems encode the username and password in the URL. If
that's what the server does, then just copy the URL. Easy.

Python can handle basic authentication easily. Have a read of these:

http://www.voidspace.org.uk/python/articles/urllib2.shtml
http://www.voidspace.org.uk/python/articles/authentication.shtml


I'm not sure about digest authentication, but it's probably similar.

If the website uses javascript to manage authentication, you've probably
got a lot of work to do.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top