Q
qa4ever
Perl gurus,
My Internet provider is providing a login screen before one gets access to
internet.
I was thinking of automate login using following script but it won't login.
Why is it failing?
use strict;
use LWP;
use URI::Escape;
use constant URL => 'http://10.0.0.6/sd/init';
my $ua = LWP::UserAgent->new;
my $newagent = 'search_rfc/1.0 (' . $ua->agent .')';
$ua->agent($newagent);
my $query_string = 'username=joeb&password=lowe';
print "echo $query_string";
my $request = HTTP::Request->new(POST => URL);
$request->content($query_string);
my $response = $ua->request($request);
die $response->message unless $response->is_success;
print "echo $response->as_string\n";
View source of 'http://10.0.0.6/sd/init' >>>>>>>>>>>>>>>>>>>>>>>>>>><
<body onload="document.pwdenter.username.focus();">
<FORM NAME="pwdenter" ACTION="login" METHOD="POST">
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" WIDTH="100%"
HEIGHT="100%">
<TR><TD>
<CENTER>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0">
<TR><TD>
<IMG SRC="/bzinfo/catv/logo1.gif" ALT="logo" BORDER="0">
<FONT SIZE="-1" FACE="Geneva, Arial">
<BR><BR>
Enter username and password.<BR>
Thereafter Press "Log on".
<BR><BR>
Användarnamn:
<BR><INPUT NAME="username"><BR>
Lösenord:
<BR><INPUT NAME="password" TYPE=PASSWORD
onBlur="this.form.username.focus();">
<BR>
<INPUT TYPE="SUBMIT" NAME="submitForm" VALUE="Log on">
</TABLE>
</TABLE>
</FORM>
</body>
Thanks,
QA4Ever
My Internet provider is providing a login screen before one gets access to
internet.
I was thinking of automate login using following script but it won't login.
Why is it failing?
use strict;
use LWP;
use URI::Escape;
use constant URL => 'http://10.0.0.6/sd/init';
my $ua = LWP::UserAgent->new;
my $newagent = 'search_rfc/1.0 (' . $ua->agent .')';
$ua->agent($newagent);
my $query_string = 'username=joeb&password=lowe';
print "echo $query_string";
my $request = HTTP::Request->new(POST => URL);
$request->content($query_string);
my $response = $ua->request($request);
die $response->message unless $response->is_success;
print "echo $response->as_string\n";
View source of 'http://10.0.0.6/sd/init' >>>>>>>>>>>>>>>>>>>>>>>>>>><
<body onload="document.pwdenter.username.focus();">
<FORM NAME="pwdenter" ACTION="login" METHOD="POST">
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" WIDTH="100%"
HEIGHT="100%">
<TR><TD>
<CENTER>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0">
<TR><TD>
<IMG SRC="/bzinfo/catv/logo1.gif" ALT="logo" BORDER="0">
<FONT SIZE="-1" FACE="Geneva, Arial">
<BR><BR>
Enter username and password.<BR>
Thereafter Press "Log on".
<BR><BR>
Användarnamn:
<BR><INPUT NAME="username"><BR>
Lösenord:
<BR><INPUT NAME="password" TYPE=PASSWORD
onBlur="this.form.username.focus();">
<BR>
<INPUT TYPE="SUBMIT" NAME="submitForm" VALUE="Log on">
</TABLE>
</TABLE>
</FORM>
</body>
Thanks,
QA4Ever