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
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.