Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
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';

Comment on WWW::Mechanize::Firefox and checkbox
Download Code
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 the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (6)
As of 2015-07-04 02:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (57 votes), past polls