How to use WWW :: Mechanize to check a radio window?

I am writing a Perl script to check certain parts of my web page when I make changes to it. Using the WWW :: Mechanize class, how can I select a radio channel and submit a form?

+6
radio-button perl www-mechanize
source share
1 answer

What have you tried? Have you checked WWW :: Mechanize Documents?

To set a field:

$mech->set_fields('radio_group_name' => 'option'); 

Remember that radio buttons are just browser instructions on how to interact with form widgets. Ultimately, all these are just fields and values ​​that you send to the web server.

To submit the form, you use one of these methods, depending on what you are trying to do:

 $mech->click_button( ... ); $mech->submit(); $mech->submit_form( ... ); 

What does a Google Code ticket look like to provide some of the best examples though .

+9
source share

All Articles