Sending username password to a webpage

K

KDawg44

Hi,

Is there a way to essentially simulate populating a text box and
calling a submit button on a webpage? I want to write an app that
gets a users information from a website and then uses that to get
information from another site. The first site requires a log in.

Thanks for any advice that gets me in the right direction.

Thanks.

Kevin
 
C

Chris Rebert

Hi,

Is there a way to essentially simulate populating a text box and
calling a submit button on a webpage? I want to write an app that
gets a users information from a website and then uses that to get
information from another site. The first site requires a log in.

There's the mechanize library for programmatic web browsing:
http://wwwsearch.sourceforge.net/mechanize/

Cheers,
Chris
 
R

r0g

KDawg44 said:
Hi,

Is there a way to essentially simulate populating a text box and
calling a submit button on a webpage? I want to write an app that
gets a users information from a website and then uses that to get
information from another site. The first site requires a log in.

Thanks for any advice that gets me in the right direction.

Thanks.

Kevin

I dread to think why you want to do that but you probably need urllib or
urllib2.


You basically need to figure out if the webpage is using GET or POST to
send the form data and then URLencode and send your data as a request.

Most forms these days will use POST.

e.g. postvars = urlencode( { "name":"john", "tel":"2384792389" } )
result = urllib.urlopen("http://www.example.com/form1",postvars)


Roger.
 

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,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top