Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Sending username password to a webpage

Reply
Thread Tools

Sending username password to a webpage

 
 
KDawg44
Guest
Posts: n/a
 
      11-21-2008
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
 
Reply With Quote
 
 
 
 
Chris Rebert
Guest
Posts: n/a
 
      11-21-2008
On Thu, Nov 20, 2008 at 7:52 PM, KDawg44 <(E-Mail Removed)> 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.


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
>

 
Reply With Quote
 
 
 
 
r0g
Guest
Posts: n/a
 
      11-21-2008
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.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Changing a users password without knowing the old password nor the answer to the password question AAaron123 ASP .Net 2 01-16-2009 02:08 PM
How to interactively sending the username/password to login using ssh cyrusgreats@gmail.com Perl Misc 4 10-27-2007 02:13 AM
loginview control displays network username instead of (web) username Shailesh Patel ASP .Net Web Controls 0 11-08-2006 08:19 PM
read a webpage with username/password jiehuang001@hotmail.com Perl Misc 6 06-13-2006 07:48 PM
Change the username found in "C:\Documents and Settings\Username" The Reluctant Robot Named Jude Computer Support 1 05-05-2004 07:11 AM



Advertisments