CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Advanced:
Information retrival from password protected site

 



benliong
Deleted

Nov 27, 2000, 12:15 AM

Post #1 of 2 (984 views)
Information retrival from password protected site Can't Post

I wrote a script to grap certain information from some site (say stock quotes). But the site requires me to log into the system before I can access those information. Now is there a way to have perl act as me, login using my username and password and then get the info?

Thanks in advance.

--Ben.


sleuth
Enthusiast

Nov 29, 2000, 10:04 PM

Post #2 of 2 (984 views)
Re: Information retrival from password protected site [In reply to] Can't Post

 
If there is a form yes, you can automate it. Just get to the login page, view the source, grab the <form action="url URL url"> get the url from there, then collect all of the hidden values together, and say the text box name for the username is "user" and password is "pass". put those after the form action url. like this.

Form:

<form action="http://www.site.com/script.cgi" method="POST">
<input type="text" name="user">
<input type="text" name="pass">
<input type="HIDDEN" name="anything" value="54">
</form>

To automate that have your script fetch the information from the url:
http://www.site.com/script.cgi?user=YOURUSERNAME&pass=YOURPASSWORD&anything=54

See what I mean?

Sleuth

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives