using perl to submit username/password and access subsequent pages

S

Sam S.

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.
 
G

Gregory Toomey

Sam said:
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
 
T

Tad McClellan

Sam S. said:
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?
 

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,744
Messages
2,569,484
Members
44,905
Latest member
Kristy_Poole

Latest Threads

Top