There is a web page that I access frequently and would like to
automate the authentication of the username and password. I would
like to user a perl script but I'm not really sure about the steps.
If someone could point me in the right direction. I don't know if
it's this simple but wouldn't it just be a matter of using the LWP
module. Calling the webpage and passing in the parameters? Any help
would be appreciated.
<html>
<title>Acceso </title>
<head>
<script>
function resetear() {
//document.form1. Usuario.value=" ";
//document.form1. Pasw.value="";
document.form1. Usuario.focus() ;
}
function validar(f) {
if (f.Usuario.valu e.length == 0) {
f.Usuario.focus ();
return false;
} else if (f.Pasw.value.l ength == 0) {
f.Pasw.focus();
return false;
}
return true;
}
</script>
<meta NAME="Author" CONTENT="">
<meta HTTP-EQUIV="Content-Type" CONTENT="text/html;
charset=iso-8859-1">
</head>
<body onLoad="resetea r();">
<br>
<center>
<font COLOR="#000080" size="+1"><b>AC CESO USUARIOS
REGISTRADOS</b></font>
<hr WIDTH="60%" SIZE=3 COLOR=#CCCC00>
</center>
<p> </p>
<form NAME="form1" METHOD="post" ACTION="index.p hp">
<center>
<table BORDER=3 WIDTH="50%" BORDERCOLORDARK =#003399
BORDERCOLORLIGH T=#3399CC RULES="groups" cellpadding=4 bgcolor=#A0A0FF >
<tr><td COLSPAN=2>  ;</td></tr>
<tr>
<td ALIGN="right">< font SIZE=4 COLOR="black">U suario:</font></td>
<td ALIGN="left"><i nput TYPE="text" NAME="Usuario" SIZE=14
MAXLENGTH=14></td>
</tr>
<tr>
<td ALIGN="right">< font SIZE=4
COLOR="black">C ontraseñ a:</font></td>
<td ALIGN="left"><i nput TYPE="password" NAME="Pasw" SIZE=14
MAXLENGTH=14></td>
</tr>
<tr align=center><t d COLSPAN=2><br>
<input TYPE="submit" VALUE="Entrar" onCLICK="return
validar(this.fo rm);">
<input TYPE="reset" VALUE="Borrar">
</td>
</tr>
<tr><td COLSPAN=2>  ;</td></tr>
</table>
</center>
</form>
<br><br>
<br>
</body>
</html>
automate the authentication of the username and password. I would
like to user a perl script but I'm not really sure about the steps.
If someone could point me in the right direction. I don't know if
it's this simple but wouldn't it just be a matter of using the LWP
module. Calling the webpage and passing in the parameters? Any help
would be appreciated.
<html>
<title>Acceso </title>
<head>
<script>
function resetear() {
//document.form1. Usuario.value=" ";
//document.form1. Pasw.value="";
document.form1. Usuario.focus() ;
}
function validar(f) {
if (f.Usuario.valu e.length == 0) {
f.Usuario.focus ();
return false;
} else if (f.Pasw.value.l ength == 0) {
f.Pasw.focus();
return false;
}
return true;
}
</script>
<meta NAME="Author" CONTENT="">
<meta HTTP-EQUIV="Content-Type" CONTENT="text/html;
charset=iso-8859-1">
</head>
<body onLoad="resetea r();">
<br>
<center>
<font COLOR="#000080" size="+1"><b>AC CESO USUARIOS
REGISTRADOS</b></font>
<hr WIDTH="60%" SIZE=3 COLOR=#CCCC00>
</center>
<p> </p>
<form NAME="form1" METHOD="post" ACTION="index.p hp">
<center>
<table BORDER=3 WIDTH="50%" BORDERCOLORDARK =#003399
BORDERCOLORLIGH T=#3399CC RULES="groups" cellpadding=4 bgcolor=#A0A0FF >
<tr><td COLSPAN=2>  ;</td></tr>
<tr>
<td ALIGN="right">< font SIZE=4 COLOR="black">U suario:</font></td>
<td ALIGN="left"><i nput TYPE="text" NAME="Usuario" SIZE=14
MAXLENGTH=14></td>
</tr>
<tr>
<td ALIGN="right">< font SIZE=4
COLOR="black">C ontraseñ a:</font></td>
<td ALIGN="left"><i nput TYPE="password" NAME="Pasw" SIZE=14
MAXLENGTH=14></td>
</tr>
<tr align=center><t d COLSPAN=2><br>
<input TYPE="submit" VALUE="Entrar" onCLICK="return
validar(this.fo rm);">
<input TYPE="reset" VALUE="Borrar">
</td>
</tr>
<tr><td COLSPAN=2>  ;</td></tr>
</table>
</center>
</form>
<br><br>
<br>
</body>
</html>
Comment