Parse website that requires login

Discussion in 'Perl Misc' started by Nalli, Mar 15, 2007.

  1. Nalli

    Nalli Guest

    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 />
     
    Nalli, Mar 15, 2007
    #1
    1. Advertising

  2. Nalli wrote:
    > 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
     
    Mark Clements, Mar 15, 2007
    #2
    1. Advertising

  3. Nalli

    cmic Guest

    Hello

    On 15 mar, 20:05, "Nalli" <> wrote:
    > 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
    --
    michel marcon SysAdmin
     
    cmic, Mar 15, 2007
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    1
    Views:
    887
  2. Replies:
    19
    Views:
    1,189
    Daniel Vallstrom
    Mar 15, 2005
  3. rockdale
    Replies:
    5
    Views:
    747
    Chad Scharf
    Jul 5, 2007
  4. Dips
    Replies:
    2
    Views:
    2,567
    Arne Vajhøj
    Jan 25, 2009
  5. 7stud --

    optparse: parse v. parse! ??

    7stud --, Feb 20, 2008, in forum: Ruby
    Replies:
    3
    Views:
    216
    7stud --
    Feb 20, 2008
Loading...

Share This Page