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


Nov 27, 2000, 12:15 AM

Views: 1889
Information retrival from password protected site

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.



Nov 29, 2000, 10:04 PM

Views: 1889
Re: Information retrival from password protected site

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 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">

To automate that have your script fetch the information from the url:

See what I mean?