Monks,
I apologize for asking to be hand held - but I did read up the FAQs, and also have been trying this myself for several hours - but cant figure out why my perl script isnt even moving to the next page - I am giving the right credentials to the web page - not sure - what is wrong -
If you could please take a look and share anything that jumps out, I would sincerely appreciate it!!!!!
#!/usr/bin/perl -w
use strict;
use WWW::Mechanize;
use HTML::TokeParser;
use HTML::TreeBuilder;
my $agent = WWW::Mechanize->new();
$agent->get("http://monitoring.cogenra.com/login");
$agent->form_id('form1');
$agent->field('ctl00$ContentPlaceHolder1$txtUname','******' );
$agent->field('ctl00$ContentPlaceHolder1$txtPwd', '******' );
$agent->click('ctl00$ContentPlaceHolder1$btn_Login');
print "\n" . $agent->success();
print $agent->status() . "\n";
#print $agent->content_type() . "\n";
#print $agent->title() . "\n";
print $agent->uri() . "\n";
$agent->form_id( 'form1' );
my $stream = HTML::TokeParser->new(\$agent->{content});
print "\n" . $agent->uri();
My output looks like this - the HTTP status code is 200 suggesting it got an 'OK' response - but the uri reported before and after the click button is the same
1200
http://monitoring.cogenra.com/login
http://monitoring.cogenra.com/login
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.