I just found this very old node by doing some searches on PM regarding a similar problem with mechanize.

Funny thing is, that whilst the answer above does address the issue at hand (and also proves the laziness of people towards searching before asking), none of the listed nodes above actually provide any clear and simple answer as to the questions posted by any of the OPs!

Anyway, I found it quite funny and peculiar, so here is the clear and simple answer:

In WWW::Mechanize radio buttons can be set just like you would set any regular text input field, but you must know the exact value of the radio button you want to select beforehand. They don't work like selects and they don't work by clicking. See examples below:

# this 'clicks' the $rb_value button in rb_name group $mech->set_fields( rb_name => $rb_value, ); # this will work as well $mech->submit_form( form_number => 1, fields => { rb_name => $rb_value, }, );

In reply to Re^2: click radio button with WWW::Mechanize by ait
in thread click radio button with WWW::Mechanize by Niner710

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.