Tuesday, 7 October 2014

Test 11: Find fields of all forms in a page

Test:
Find fields of all forms in a page

Learning: 
 param is used to get fields of a form


Solution:

use WWW::Mechanize;
use LWP::UserAgent;
my $m = WWW::Mechanize->new();
$m->get( "http://www.rediff.com/" );
@arr=$m->forms;
$count=1;
foreach (@arr)
{
my @inputfields = $_->param;
print "form $count fields are:\n";
$count++;
foreach(@inputfields)
{
print "$_\n";
}
  print "\n";      
  }


output snapshot:

No comments:

Post a Comment