Dear Monks,...
Please I ask for you patience and wisdom...
I have this script;
require LWP::UserAgent;
my $ua = LWP::UserAgent->new;
$ua->timeout(10);
$ua->env_proxy;
my $response = $ua->get('http://toolsview/bcp_tool/');
if ($response->is_success) {
print $response->content; # or whatever
}
else {
die $response->status_line;
}
the output I get is;
<html>
<head>
<title>BCP Administrator Console</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1
+">
</head>
<frameset rows="90,*" frameborder="NO" border="0" framespacing="0" col
+s="*">
<frame name="top" scrolling="NO" noresize src="top.asp" frameborder=
+"NO" >
<frame name="main" src="logon.asp">
</frameset>
<noframes>
<body bgcolor="#FFFFFF" text="#000000">
</body>
</noframes>
</html>
Which is a web page that requests users to login (i.e. to insert a user ID and a password then click on the 'Login' button).
My question is, can I automate the login process using Perl and how would I be able to do this? - This is only a prelude to more complicated things to come with LWP - and I will continue to read LWP documentation. However the answer to my enquiry will be a good spring board to launch me into Web programming.
Thanks
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|