KaiAllard_ has asked for the wisdom of the Perl Monks concerning the following question:

Hello dear monks,

I have again some trouble with a webdatabase. I want to post some data in order to receive some information. But I receive "Search criteria are not set correctly" whatever option, selection, etc. I set. I would greatly appreciate any help. What option do I not set correctly? Even there I have no clue (I tempered the data). If you go manually on the webpage indicated above: The first raw should have CAS Registry No then 50-00-0 then Exact Match. The other raw is not important.

my $url = URI->new('http://www.safe.nite.go.jp/data/hazkizon/' . 'pk_e_kizon_input_second.home_object'); for my $cas ( '50-00-0', '50-50-1' ) { $mech->get($url); if ( $mech->success() ) { $mech->form_number(1); $mech->select( sel_item1 => 'cas_no' ); $mech->set_visible( [ text => $cas ] ); $mech->select( search_meth1 => 'full' ); $mech->submit(); } }

Replies are listed 'Best First'.
Re: Trouble with posting to a webpage
by KaiAllard_ (Initiate) on Nov 27, 2007 at 08:59 UTC
    OK found out. For whatever reason $mech->submit() did not work but $mech->click_button( name => 'sub1' ).
      Usually this happens if there is more than one form on the page, and you've not selected the form you're interested in.

      -David

        Just one single form on the page and I selected it $mech->form_number(1);. Thank you anyway.