By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,050 Members | 1,009 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,050 IT Pros & Developers. It's quick & easy.

Sending username password to a webpage

P: n/a
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
Nov 21 '08 #1
Share this Question
Share on Google+
2 Replies


P: n/a
On Thu, Nov 20, 2008 at 7:52 PM, KDawg44 <KD*****@gmail.comwrote:
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
--
Follow the path of the Iguana...
http://rebertia.com
>
Thanks for any advice that gets me in the right direction.

Thanks.

Kevin
--
http://mail.python.org/mailman/listinfo/python-list
Nov 21 '08 #2

P: n/a
r0g
KDawg44 wrote:
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.
Nov 21 '08 #3

This discussion thread is closed

Replies have been disabled for this discussion.