Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

WWW::Mechanize::Firefox follow link

by mmittiga17 (Scribe)
on Mar 05, 2012 at 14:35 UTC ( #957907=perlquestion: print w/replies, xml ) Need Help??

mmittiga17 has asked for the wisdom of the Perl Monks concerning the following question:

Hi All, Quick question on how to follow a link in mech firefox. Any help is greatly appreciated. Link Code:

<a class="ctl00_Menu1_1 DynamicMenuItemStyle ctl00_Menu1_6" href="java +script:LoadinIframe('InvestmentDetail.aspx?FromMenu=Y&amp;MainMenu=Y' +,'Investment Detail','Yes')" target="_self" style="border-style:none; +font-size:1em;">Investment Detail</a>

I have tried each of these methods with no luck:

$mech->follow_link( text_contains=> '//a[text() = "Investment Detail" +]' ); $mech->follow_link( url_regex => qr/InvestmentDetail.aspx/i ); $mech->follow_link( xpath => '//a[text() = "Investment Detail"]' ); $mech->follow_link( text => 'Investment Detail',n => 12 );

Any thoughts? Thanks!!

Replies are listed 'Best First'.
Re: WWW::Mechanize::Firefox follow link
by Corion (Patriarch) on Mar 05, 2012 at 17:39 UTC

    You will have to ->click() the according link object. ->follow_link does not work with Javascript links.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (2)
As of 2023-01-29 19:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?