Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
This is my first post here. Let me know if I format something outside of what you guys prefer. I like that you guys do your best to inform new people how to not frustrate the community. Anyway, I am running Strawberry Perl v5.12.3 on windows (I really only say this because parts of mech perl seem buggy, but I admit it could be my perl), and I need to follow this link.:
<a class="menuItem" href="#" onclick="sListView.check_entire_list(document.MassUpdate, "mass[]",true,4063);" onmouseout="unhiliteItem(this);" onmouseover="hiliteItem(this,"yes");" style="width: 150px">Select All (4063)</a>
The problem with this box, may be that it is hidden and only shows up when you click a javascripted button. Yes, hidden, it is not some ajax appearing nonsense. I figured it would still parse it, but I seriously tried 50 or so regexes. Less ideally(WAY less, but I would put up with it), I could check this box, and add a massive amount of logic to click through pages that are variable. :/
<input id="massall" class="checkbox" type="checkbox" onclick="sListView.check_all(document.MassUpdate, "mass[]", this.checked);" value="" name="massall">
I have tried these kinds of things:
$mech->follow_link( text_regex => /select\sall/i ) if $mech->success() +; $mech->find_link(text_regex=>/select/i);
It always returns saying that there is a use of uninitialized variable $_ in the mech perl code, or it says that I initialized a hash with an odd number of items and so forth. So... I went through the more annoying method (this one will probably add 3 or 4 days to my project, but whatever). Let's check the box:
$mech->tick( 'massall', /\s/ ); $mech->tick( 'massall', / / ); $mech->tick( 'massall', '' ); $mech->tick( 'massall', 0 ); $mech->tick( 'massall', ' ' );
Perl wont allow use of uninitialized value, null value or it cannot find or \s. It not finding \s is bizarre to me because then I leave a null value it states that the regex is not valid. What do I do?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Mech::Perl and following links w/ null value
by Corion (Patriarch) on Apr 18, 2012 at 13:56 UTC | |
|
Re: Mech::Perl and following links w/ null value
by tobyink (Canon) on Apr 18, 2012 at 13:52 UTC | |
|
Re: Mech::Perl and following links w/ null value
by ajinkyagadewar (Novice) on Apr 19, 2012 at 06:32 UTC |