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

Hi Monks

I tryout a code for login into a webpage and i try to click a hyper reference link (if i click the hyper link i will be move to the another page) but it's not working

my $find_link=$mech->find_link(text =>$mbs_text); my $temp=@{$find_link}; #print %{$mech->response()}; if($find_link) { print " found\n\n"; $mech->click($mbs_text); print $mech-> content(format=>'text'); } else { print " not found...\n\n\n"; } my @main_all_link= $mech->find_all_link(); print @main_all_link,"\n";

Queries:

1. How to click the hyper reference link in webpage 2. How to get all hyper link in the same webpage

Replies are listed 'Best First'.
Re: Clicking hyperlink in a webpage
by Corion (Patriarch) on May 18, 2016 at 11:07 UTC

    You don't tell us what module you are using, but maybe reading the documentation of WWW::Mechanize will help you?

      I am using WWW::Mechanize to work on webpage content

Re: Clicking hyperlink in a webpage
by LanX (Saint) on May 18, 2016 at 11:48 UTC
    Does the link work in your browser after disabling JS?

    Cheers Rolf
    (addicted to the Perl Programming Language and ☆☆☆☆ :)
    Je suis Charlie!

Re: Clicking hyperlink in a webpage
by Anonymous Monk on May 18, 2016 at 11:40 UTC