help_3452 has asked for the wisdom of the Perl Monks concerning the following question:
Hello All, I need help! I'm totally confused.
I'm trying to access and list the forms available on a page using WWW::Mechanize::Firefox
It is not behaving as I expected.
use strict; use warnings; use diagnostics; use Data::Dumper; use WWW::Mechanize::Firefox; my $mech = WWW::Mechanize::Firefox->new( #env_proxy => 1, #keep_alive => 1, #timeout => 30, #autocheck => 1, autoclose => 1, js_JSON => 'native' ); $mech->get("http://www.w3schools.com/html/html_forms.asp"); my $index; my @forms = $mech->forms(); my $form_obj ; while ( ($index, $form_obj) = each @forms) { print "$index : ", $form_obj , "\n"; #print Dumper ($form_obj), "\n"; } exit;
The $form_obj that is returned is a MozRepl::RemoteObject::Instance.
When I do a print Dumper on it, i can't see anything remotely useful. Everything appears to be describing the connection to Firefox, and i can't see anything to do with a form.
What I'm trying to do is print a list of forms available on a page and then allow the user to select the form in order to input some data.
I've tried googling for some examples of forms with Mechanize::Firefox and MozRepl::RemoteOjects but what i found was neither clear nor well explained. Any assistance would be greatly appreciated!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Completely Confused with Mechanize::Firefox Forms
by daxim (Curate) on Jul 12, 2013 at 17:15 UTC | |
by help_3452 (Initiate) on Jul 12, 2013 at 17:36 UTC | |
by PerlSufi (Friar) on Jul 12, 2013 at 17:59 UTC | |
by help_3452 (Initiate) on Jul 12, 2013 at 23:45 UTC | |
by PerlSufi (Friar) on Jul 14, 2013 at 17:42 UTC | |
by help_3452 (Initiate) on Jul 12, 2013 at 18:26 UTC | |
by PerlSufi (Friar) on Jul 12, 2013 at 19:43 UTC | |
by Anonymous Monk on Jul 13, 2013 at 07:43 UTC | |
by Anonymous Monk on Jul 13, 2013 at 07:58 UTC |