in reply to Re: how smart www::mechanize can be?
in thread how smart www::mechanize can be?

Hi. I tried
my $form; foreach ( $mech->forms ){ if( $_->find_input( 'shopwizard' )){ $form = $_; last; } } print "---------------------- form was $form"; $mech->submit_form( form_number => $form, fields => { shopwizard => "Winter Love Usuki Set", criteria => 'exact' } );
and it's erroring out now. When I print the $form, it prints HTML::Form=HASH(..). So if the $form has this, could this mean it's not passing the right information to my form?

Replies are listed 'Best First'.
Re^3: how smart www::mechanize can be?
by ikegami (Patriarch) on Mar 28, 2006 at 19:58 UTC
    my $forms = $mech->forms(); my $form_num; for (0..$#$forms) { if ($forms->[$_]->find_input('shopwizard')) { $form_num = $_ + 1; last; } } die("Unable to find shopwizard form\n") unless $form_num; $mech->submit_form( form_number => $form_num, fields => { shopwizard => "Winter Love Usuki Set", criteria => 'exact' } );