Parse website that requires login

N

Nalli

I need to know how to login to a website using perl and then be able
to parse any page on the site, once logged in. I would appreciate it
very much if someone could post a working example. The website uses a
form to login. Below is some html from the site.

div id="loginarea">

<div class="top_margin" align="center"><div class="main_box"
style="width: 450px;">

<form action="/loginauth" method="post" name="login" onsubmit="return
submit_it();">
<input type="hidden" name="rurl" value="">
<input type="hidden" name="m" value="">


<span class="main_title">Welcome </span><br />
<br />
<table>
<tr><td>Username:</td><td><input type="text" name="username"
style="width: 200px;" maxlength="50" value=""></td></tr>
<tr><td>Password:</td><td><input type="password" name="password"
value="" style="width: 200px;" maxlength="25"></td></tr>
<tr><td></td><td><p style="font-size: 11px;"><input type="checkbox"
name="keep_me_logged_in" value="1" /> Remember me on this Computer</p>

<p style="padding-bottom: 15px; "><input type="submit" id="signin"
value="&raquo; Sign In" class="button"></p>
<a href="forgotpw?rurl=">Forget your Username or Password?</a><br />
 
M

Mark Clements

Nalli said:
I need to know how to login to a website using perl and then be able
to parse any page on the site, once logged in. I would appreciate it
very much if someone could post a working example. The website uses a
form to login. Below is some html from the site.
<snip>
Check out

WWW::Mechanize

Mark
 
C

cmic

Hello

I need to know how to login to a website using perl and then be able
to parse any page on the site, once logged in. I would appreciate it
very much if someone could post a working example. The website uses a
form to login. Below is some html from the site.
[...]
Another possible way to do this is to use a
proxy http like wsp.pl (google : web scraping proxy server)
which should write part of the necessary code. Then, all you
have to do is to customize the code with :

use HTTP::Request::Common qw(POST GET);
use LWP::UserAgent;
....

tested !
Regards
 

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

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,045
Latest member
DRCM

Latest Threads

Top