in reply to Perl WWW::Mechanize::Firefox checkbox tick problem

marto spotted the problem. Your search arguments don't match your HTML. Ignore this reply. Update2: It seems that this reply still might apply:

It seems that the following lines are the problematic parts in WWW::Mechanize::Firefox::tick:

... $name = quotemeta($name); $value = quotemeta($value) if $value; ...

I think they should only escape double quotes (as that is what is used to produce the XPath expression.

I recommend using the hashref option to ->tick instead, at least until a fix comes:

$mech->tick({ xpath => '//input[@type="checkbox" and @name="profession +Area[]"' }, 1);

Replies are listed 'Best First'.
Re^2: Perl WWW::Mechanize::Firefox checkbox tick problem
by elols (Initiate) on Feb 06, 2012 at 10:10 UTC
    Sorry - my bad. In this site there are 2 checkboxes - interested[] and professionArea[]. I can't tick both. And what can I do? And right - there is input names "interested[]" . I wanna tick both but i can't - $mech->field('interested[]' => '1'); didn't work. Have you any sugestion? UPDATE: I use your code : $mech->tick({ xpath => '//input[@type="checkbox" and @name="professionArea[]"' }, 1); and I got message:
    MozRepl::RemoteObject: NS_ERROR_DOM_INVALID_EXPRESSION_ERR: The expres +sion is no t a legal expression. at C:/Perl/site/lib/WWW/Mechanize/Firefox.pm lin +e 2059
    This is it:
    ... my @found = map { $doc->__xpath($_, $n) } $q; # @$query; ...
    EDIT: \o/ YEAH \o/ . Thanks for help. I commented line with quoted and all works fine. Thanks bro!!!!!!!