I need to download a page which is password-protected (php):
http://marketsmart-real.pcquote.com/login.php?redirectLocation=getquote.php?symbol=NDX

When accessing the former page, it is requested a user and password via a form.
Used AJS2 and password dosmil work fine.
Now what I want is to emulate the manual login using LWP in order of getting 
the webpage contents.
After inspecting the resulting form html code, I found that it has the 
following parameters:

<FORM NAME="theForm" METHOD="POST">
<INPUT TYPE="hidden" NAME="redirectLocation" VALUE="getquote.php?symbol=NDX">
<INPUT TYPE="text" NAME="username" SIZE=20>
<INPUT TYPE="password" NAME="password" SIZE=20>
<INPUT TYPE="submit" VALUE="Login">
</FORM>


So I've tried to get the page using LWP, passing some parameters using the POST 
method:

use LWP::UserAgent;
$ua = new LWP::UserAgent;
$get_url="http://marketsmart-real.pcquote.com/login.php";;
$req = HTTP::Request->new(POST=>$get_url);

$req->content(   redirectLocation=>"getquote.php?symbol=NDX",
                        user=>"AJS2",
                        password=>"dosmil");


$webpage=$ua->request($req)->as_string;
print $webpage;


The problem is that the result in $webpage says that the user or password are 
erroneous, but they are correct and work perfect by typing them manually.
Am I doing something wrong when passing the parameters to the php script?
I've also tried to pass parameters in the following form, unsuccessfully:
$req->content("+redirectLocation='getquote.php?symbol=NDX'&+user=AJS2&+password=dosmil");

Any idea?

Thank you

Alejandro
_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to