Hi Monks,
I am looking to become familiar with the WWW::Mechanize Module. I am trying to learn how to automate inputs in some fields but dont quite understand why I see different outputs with the following code at different uri....
#!/usr/bin/perl -w use WWW::Mechanize; use strict; my $mech = WWW::Mechanize->new(); $mech->get("https://www.google.com/"); #$mech->get("https://www.southwest.com/"); print $mech->uri(); print "\n"; my @theForms = $mech->forms(); print $#theForms."\n"; #How many forms are returned in the array foreach my $form (@theForms) { my @inputfields = $form->param; foreach my $input (@inputfields){ print $input."\n"; } }
When I navigate to google.com, I get this output listing the size of the form array and the fields within each form object
https://www.google.com/ 0 ie hl source biw bih q btnG btnI gbv
When I navigate to southwest.com, I get this output telling me there are no forms? Why might this be?
https://www.southwest.com/ -1
Thanks in advance!
In reply to WWW::Mechanize Forms... by lstacey
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |