in reply to Mechanize:submit_form issue.
#!/usr/bin/perl -- use strict; use warnings; use WWW::Mechanize 1.60; #implies autocheck => 1 my $url = 'http://host:7777/fagcs_302_C600_sfosun05/domain/'; #my $url = 'http://host:7778/fagcs_320_C106_sfoaix04/domain/'; my $username = 'usrname'; my $password = 'pswd'; my $agent = WWW::Mechanize->new( autocheck => 1 ); if ( eval { $agent->get($url); 1 } ) { eval { $agent->submit_form( form_number => 0, fields => { 'j_username' => $username, 'j_password' => $password, }, ); 1; } or do { print "error :($@)\n"; print "Couldn't submit form:" . $agent->status() . ":" . ":" . $agent->content() . "\n"; }; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Mechanize:submit_form issue.
by perlcoding (Initiate) on Sep 16, 2009 at 15:52 UTC | |
by perlcoding (Initiate) on Oct 05, 2009 at 09:18 UTC | |
by Anonymous Monk on Oct 05, 2009 at 09:41 UTC | |
by perlcoding (Initiate) on Oct 05, 2009 at 12:27 UTC |