Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > send username/password via perl script instead of using browser

Reply
Thread Tools

send username/password via perl script instead of using browser

 
 
john brown
Guest
Posts: n/a
 
      07-29-2004
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.value.length == 0) {
f.Usuario.focus();
return false;
} else if (f.Pasw.value.length == 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="resetear();">
<br>
<center>
<font COLOR="#000080" size="+1"><b>ACCESO USUARIOS
REGISTRADOS</b></font>
<hr WIDTH="60%" SIZE=3 COLOR=#CCCC00>
</center>

<p>&nbsp;</p>
<form NAME="form1" METHOD="post" ACTION="index.php">
<center>
<table BORDER=3 WIDTH="50%" BORDERCOLORDARK=#003399
BORDERCOLORLIGHT=#3399CC RULES="groups" cellpadding=4 bgcolor=#A0A0FF>
<tr><td COLSPAN=2>&nbsp;</td></tr>
<tr>
<td ALIGN="right"><font SIZE=4 COLOR="black">Usuario:</font></td>
<td ALIGN="left"><input TYPE="text" NAME="Usuario" SIZE=14
MAXLENGTH=14></td>
</tr>
<tr>
<td ALIGN="right"><font SIZE=4
COLOR="black">Contrase&ntilde;a:</font></td>
<td ALIGN="left"><input TYPE="password" NAME="Pasw" SIZE=14
MAXLENGTH=14></td>
</tr>
<tr align=center><td COLSPAN=2><br>
<input TYPE="submit" VALUE="Entrar" onCLICK="return
validar(this.form);">
&nbsp;
<input TYPE="reset" VALUE="Borrar">
</td>
</tr>
<tr><td COLSPAN=2>&nbsp;</td></tr>
</table>
</center>
</form>
<br><br>
<br>
</body>
</html>
 
Reply With Quote
 
 
 
 
Robert Gauld
Guest
Posts: n/a
 
      07-29-2004
Not sure if it helps, but when I need to do this in a link on a
webpage (that is presenter the user name and password), I use the
following URL:

http://<username>:<password>@<address>

simply replace <address> with the URL of the page, <username> with the
user name and <password> with the password.

On 29 Jul 2004 04:09:03 -0700, http://www.velocityreviews.com/forums/(E-Mail Removed) (john brown)
wrote:

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


 
Reply With Quote
 
 
 
 
Christopher Shatto
Guest
Posts: n/a
 
      08-03-2004
john brown wrote:

> 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



If you login with a perl/lwp script, your login info (such as the cookie
that the site will likely set) will be set to your lwp cookies, not your
browser, so you won't be logged in when you go back to the site in your
browser anyway. I suppose this would work if the site is checking logins
based on IP, but that's dumb and they shouldn't be doing it...
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem in passing values to perl script using another perl script vikrant Perl Misc 4 08-10-2005 06:20 PM
problem calling perl script from SOAP server perl script pj Perl Misc 3 04-09-2004 10:23 PM
Send html generated page to a string instead to browser NWx ASP .Net 2 02-17-2004 09:48 PM
Perl Help - Windows Perl script accessing a Unix perl Script dpackwood Perl 3 09-30-2003 02:56 AM
How to make Perl Script "POST" call from another Perl Script??? Wet Basement Perl 1 07-15-2003 10:25 PM



Advertisments