Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
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 drinking their drinks and smoking their pipes about the Monastery: (11)
As of 2014-09-30 13:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (369 votes), past polls