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

Hi, How to select radio button using mechanize module. I used WWW::Mechanize module and i am wanto select radio button. how i can do. i want to select some buttons by using this module and i want to next processes. can u help regarding this one thanks, chandu chandu_paga@yahoo.com
  • Comment on how to select radio button using mechanize module

Replies are listed 'Best First'.
Re: how to select radio button using mechanize module
by marto (Cardinal) on Jul 06, 2006 at 10:24 UTC
    chandu,

    Have you read the WWW::Mechanize documentation? If you are looking to submit a form which has a set the radio button to the value you want:
    $mech->submit_form( form_number => 1, fields => { #Radio button name | Value myRadioButton => 'myRadioButton_Value', } );
    If you do not know the name of the radio button or the value you may want to investigate the $mech->set_visible method. If you are having problems please provide your code, the example html and the errors generated. If this post is also yours please read the links I provided

    Hope this helps.
    .

    Martin
Re: how to select radio button using mechanize module
by planetscape (Chancellor) on Jul 06, 2006 at 19:53 UTC

    My boilerplate advice to those seeking assistance with WWW::Mechanize is this:

    I would try using a module such as HTTP::Recorder or WWW::Mechanize::Shell to record a successful manual form submission. The output of HTTP::Recorder, for instance, can be "dropped" right into your WWW::Mechanize scripts. (leira's article "Web Testing with HTTP::Recorder" contains an excellent example of how you might want to do this.)

    Another important tool for finding out what is really happening behind the scenes between server and browser is a protocol analyzer such as Ethereal.

    Don't forget that Super Search is your friend here on PM. Many questions such as yours have been asked recently...

    And... you might not want to post your e-mail address on this forum... Coming back to read replies is the recommended method. :-)

    HTH,

    planetscape