fanasy has asked for the wisdom of the Perl Monks concerning the following question:
sorry, please help me on my question is " why the module html::form $input->name work,$input->value doesn't work" under the html context:use diagnostics; use WWW::Mechanize; use Data::Dumper; use HTML::Form; use Encode; use WWW::Mechanize::Plugin::Display; my $name = Encode::decode('GB2312', '刷 新'); my $CACTIURL = "xxxxxxxxxxxxx"; my $ADMINPASSWORD = "zhiyuan"; my $mech = WWW::Mechanize->new(); $mech->get($CACTIURL); $mech->set_visible("xxxxxx", $ADMINPASSWORD); $mech->click; my $link_m = $mech->find_link(url_regex => qr/W0QQactZsale/); my $value_hash =$link_m->url(); $mech->get($link_m); $mech->form_number(2); my @inputs = $mech->current_form()->inputs(); #print "inputs: @inputs\n"; foreach my $input2 (@inputs) { my $input_type= $input2->type; my $input_id= $input2->id; my $input_value= $input2->value; my $input_name= $input2->name; if ($input_type eq "checkbox") { print "LOG: input_name $input_name\n"; print "LOG: input_id $input_id\n"; print "LOG: input_value $input_value\n"; #$mech->field($input2=>'on'); $mech->tick($input2->name,$input2->value); } } $mech->display; foreach my $input3 (@inputs) { my $input_value =$input3->id; #print "LOG:input_value $input_value\n"; if($input_value eq "fresh0"){ #print "LOG:input3 $input3\n"; $mech->click_button(input=>$input3); } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: when use html::form $input->name work,$input->value doesn't work
by Tanktalus (Canon) on Nov 14, 2010 at 05:28 UTC | |
|
Re: why when I use html::form $input->name work,$input->value doesn't work ?
by Anonymous Monk on Nov 14, 2010 at 06:05 UTC | |
by fanasy (Sexton) on Nov 14, 2010 at 06:56 UTC | |
by Corion (Patriarch) on Nov 14, 2010 at 09:04 UTC | |
by fanasy (Sexton) on Nov 14, 2010 at 11:17 UTC | |
by fanasy (Sexton) on Nov 14, 2010 at 11:08 UTC | |
by Corion (Patriarch) on Nov 14, 2010 at 11:14 UTC | |
|