Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

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?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (4)
As of 2017-02-25 23:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Before electricity was invented, what was the Electric Eel called?






    Results (369 votes). Check out past polls.