Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I am using WWW::Mechanize::Firefox and want to follow a link on a page that uses javascript. I have tried using the follow_link function, Firefox shows the linked page but the Perl code hangs.
$mech->follow_link( n => 3 );
If I add synchronize => 0 then it continues but the html in $mech->contents is not updated.
$mech->follow_link( n => 3, synchronize => 0 );
I have also tried using the click call with the following code but I get the error message "Can't locate object method "__click" via package "WWW::Mechanize::Link"..."
my @links = $mech->links(); $mech->click({dom => $links[3]});
And with the following code the error message is "Can't locate object method "click" via package "WWW::Mechanize::Link"..."
my @links = $mech->links(); $links[3]->click();
Any help with the correct method to use would be very much appreciated.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: WWW::Mechanize::Firefox follow link with javascript
by Corion (Patriarch) on Dec 10, 2012 at 14:17 UTC | |
by Anonymous Monk on Dec 10, 2012 at 16:15 UTC |
Back to
Seekers of Perl Wisdom