using perl to submit username/password and access subsequent pages

Discussion in 'Perl Misc' started by Sam S., Feb 9, 2005.

  1. Sam S.

    Sam S. Guest

    Semi-newbie here. I am trying to write a perl script that uses LWP to
    access the web pages that follow the initial login at
    https://www.shopqf.com/login.asp

    Of course I have a valid username and password that work when I use IE
    but I want to do this entirely within perl.

    I have tried a few methods in perl, including using the do_POST
    functions and trying to use cookies, but obviously I am not doing
    something right.

    It seems the login page uses some YY_checkform function that I don't
    understand and would prefer to not get into. I'd like to stick with
    doing this in perl only.

    Again, the goal is to use perl to login to this web site, then dig
    around some of the subsequent web pages.

    Any ideas? Thanks a lot folks!

    Sam S.
     
    Sam S., Feb 9, 2005
    #1
    1. Advertising

  2. Sam S. wrote:

    > Semi-newbie here. I am trying to write a perl script that uses LWP to
    > access the web pages that follow the initial login at
    > https://www.shopqf.com/login.asp
    >
    > Of course I have a valid username and password that work when I use IE
    > but I want to do this entirely within perl.
    >
    > I have tried a few methods in perl, including using the do_POST
    > functions and trying to use cookies, but obviously I am not doing
    > something right.
    >
    > It seems the login page uses some YY_checkform function that I don't
    > understand and would prefer to not get into. I'd like to stick with
    > doing this in perl only.
    >
    > Again, the goal is to use perl to login to this web site, then dig
    > around some of the subsequent web pages.
    >
    > Any ideas? Thanks a lot folks!
    >
    > Sam S.


    You can try
    http://search.cpan.org/~petdance/WWW-Mechanize-1.08/lib/WWW/Mechanize.pm

    gtoomey
     
    Gregory Toomey, Feb 9, 2005
    #2
    1. Advertising

  3. Sam S. <> wrote:

    > I am trying to write a perl script that uses LWP to
    > access the web pages that follow the initial login at
    > https://www.shopqf.com/login.asp



    > I have tried a few methods in perl,



    Where have been POSTing the request to?


    > It seems the login page uses some YY_checkform function that I don't
    > understand and would prefer to not get into.



    It is JavaScript, we don't want to get into it either.


    > Any ideas? Thanks a lot folks!



    The easiest way would be to use the Web Scraping Proxy, or similar,
    to find out what requests are going back and forth:

    http://www.research.att.com/~hpk/wsp/


    The harder way would be to figure out what this does:

    <form action="dologin.asp" method="post" name="form1" class="shopqf" onSubmit="YY_checkform('form1','theusername','#q','0','Username is required.','thepassword','#q','0','Password is required.');return document.MM_returnValue">

    But what that does has nothing to do with Perl, so this is not an
    appropriate place to be doing that.


    Anyway, are you POSTing to "dologin.asp" like the form action says to?


    --
    Tad McClellan SGML consulting
    Perl programming
    Fort Worth, Texas
     
    Tad McClellan, Feb 9, 2005
    #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. john brown
    Replies:
    2
    Views:
    953
    Christopher Shatto
    Aug 3, 2004
  2. Jan Faerber
    Replies:
    3
    Views:
    475
    Robert Frost-Bridges
    Jul 27, 2003
  3. brucie
    Replies:
    1
    Views:
    474
    Nobody
    Jul 28, 2003
  4. mazdotnet
    Replies:
    1
    Views:
    314
    bruce barker
    Jul 28, 2008
  5. John
    Replies:
    13
    Views:
    376
Loading...

Share This Page