Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

WWW::Mechanize::Firefox Navigate Issue !

by Matt™ (Acolyte)
on Nov 03, 2012 at 12:52 UTC ( #1002101=perlquestion: print w/ replies, xml ) Need Help??
Matt™ has asked for the wisdom of the Perl Monks concerning the following question:

Dear Mons, I have a doubt regarding the below codes. Can you pls suggest a way?

Is there a provision to pass a string to it like below,

my $Pager = "submit"; my $find_button = $mech->xpath('//*[@id="$Pager"]', single => 1 ); $mech->click( $find_button );

Its not getting me through! Giving an error like 'NO elements found'

Thanks in advance.

Comment on WWW::Mechanize::Firefox Navigate Issue !
Download Code
Re: WWW::Mechanize::Firefox Navigate Issue !
by hippo (Curate) on Nov 03, 2012 at 14:45 UTC

    Using single quotes like you have in your example supresses variable substitution in Perl just like it does in bash. See what happens here:

    my $bcount = 5; print "I ate $bcount biscuits "; print 'I ate $bcount biscuits ';

    Use single quotes for literal strings, use double quotes for interpolation (including variable substitution.

Re: WWW::Mechanize::Firefox Navigate Issue !
by aitap (Deacon) on Nov 04, 2012 at 08:10 UTC
      *cough*  Possible unintended interpolation of @id in string at - line 1.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1002101]
Approved by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (18)
As of 2014-12-19 18:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (91 votes), past polls