Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

WWW Mechanize!!!

by lpanokarren (Novice)
on Sep 29, 2013 at 05:34 UTC ( #1056183=perlquestion: print w/ replies, xml ) Need Help??
lpanokarren has asked for the wisdom of the Perl Monks concerning the following question:

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

Comment on WWW Mechanize!!!
Select or Download Code
Re: WWW Mechanize FAQ!!!
by Anonymous Monk on Sep 29, 2013 at 06:25 UTC

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1056183]
Approved by Athanasius
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (12)
As of 2014-12-26 15:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (171 votes), past polls