Test:
Enter a value in a form of a page, submit the form and check title of resulting page
Solution:
use LWP::UserAgent;
my $m = WWW::Mechanize->new();
$m->get( "http://en.wikipedia.org/wiki/Main_Page" );
$m->submit_form(
form_number => 1,
fields => { search => 'honey', },
button => 'go'
);
$tmp=$m->title;
print "$tmp\n";

No comments:
Post a Comment