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

Dear monks,

I extract page in one site through WWW::Mechanize. Here, by entering fields and click('login'), I enter into the next page. There is an site1 by clicking link i have to go to page and i have to extract text is it possible. If i have pass url by get method each time i have to login. so, is it possible to click links and extract page.

Thanks in advance

Updated Steve_p - removed link to dead site1

  • Comment on Is it possible to click link in WWW::Mechanize

Replies are listed 'Best First'.
Re: Is it possible to click link in WWW::Mechanize
by jbrugger (Parson) on Jul 20, 2005 at 04:34 UTC
    Please don't use dead links in your posting,
    > is it possible to click links and extract page
    Yes; as WWW:Mechanize shows us:

    $mech->follow_link( url => 'http://host.com/index.html' );
    and print  $mech->response() ;
    "We all agree on the necessity of compromise. We just can't agree on when it's necessary to compromise." - Larry Wall.
Re: Is it possible to click link in WWW::Mechanize
by Your Mother (Archbishop) on Jul 20, 2005 at 04:38 UTC

    This question is rather confusing. It's possible to click regular form buttons which you seem to know already. It's also possible to follow specific links. It's not possible to click JavaScript controlled links. Refer to the pod, WWW::Mechanize, and look for these methods. The site you linked is down/unavailable at this time.

    $mech->click( $button [, $x, $y] ) $mech->click_button( ... )

    Maybe what you need to do is manage your cookies better...? Check the pod for cookie info too.