Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid

Trouble with posting to a webpage

by KaiAllard_ (Initiate)
on Nov 26, 2007 at 16:29 UTC ( #653027=perlquestion: print w/replies, xml ) Need Help??
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('' . '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.


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

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://653027]
Approved by Corion
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (10)
As of 2018-10-15 21:14 GMT
Find Nodes?
    Voting Booth?
    When I need money for a bigger acquisition, I usually ...

    Results (82 votes). Check out past polls.