I am trying to get data from a webpage that I need to log into via a ssl html form. When I try, all I get is the login page html. I have Crypt:SSLeay (I forget the exact module) installed. Am I doing something fundamentally wrong here? I would appreciate any help I could get. Thank you very much! ~Erithid

Snippit from html form:

<form name="frmLogin" method="post" action="login.aspx" id="frmLogin" 
autocomplete="on">
<input name="txtLoginName" type="text" id="txtLoginName" class="fill_width" />
<input name="txtPassword" type="password" id="txtPassword" class="fill_width" 
/></td>
<input type="submit" name="cmdLogin" value="Login" id="cmdLogin" title="Click here to attempt to 
login" class="button" />

my perl code:

use LWP 5.64;
use HTTP::Cookies;
my $browser = LWP::UserAgent->new(agent =>
        'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; T312461)' ,
        'cookie_jar' => {file => "lwpcookies.txt", autosave => 1,ignore_discard 
=> 1}
);

my $id = 'user';
my $pass= 'pass';
my $url = 'https://site.com/login.aspx';
 my $response = $browser->post( $url,
[ 'txtLoginName' =>$id, 'txtPassword'=>$pass,
     'cmdLogin'=>'Login',
   ]
 );
my $mystring = $response->content;
open(OUT,">webtest.txt");
print OUT $mystring;
close OUT;






--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to