Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw

WWW::Mechanize::Firefox and checkbox

by diwaniuk (Initiate)
on Apr 03, 2014 at 11:43 UTC ( #1080933=perlquestion: print w/replies, xml ) Need Help??
diwaniuk has asked for the wisdom of the Perl Monks concerning the following question:

Hi, I am trying to click a checkbox that looks like the following:
<td><input id="chkBsc" type="checkbox" class="rdo" onclick="clkBsc();" +></td>
How can I do this? I know function tick() but they accept only 'name' and 'value' but not 'id';

Replies are listed 'Best First'.
Re: WWW::Mechanize::Firefox and checkbox
by Corion (Pope) on Apr 03, 2014 at 12:12 UTC

    The documentation for ->tick says as its last sentence:

    If $name is a reference to a hash, that hash will be used as the options to ->find_link_dom to find the element.

    So you can pass the appropriate parameters for ->find_link_dom:

    $mech->tick( { id => 'chkBsc' }, '', 1 );
      Now it's works! Thanks a lot!

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1080933]
Front-paged by Arunbear
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (5)
As of 2018-05-24 20:34 GMT
Find Nodes?
    Voting Booth?