in reply to Re: Link Extracter using Mechanizemodule
in thread Link Extracter using Mechanizemodule

Hi,

I want to extract a link which is not in Tag.

Consider this is my source

"location='http://www.loopnet.com/looplink/lund/qryradio.aspx'");

From my source i can extract this link (http://www.facebook.com/) .I need to extract this link( http://www.loopnet.com/looplink/lund/qryradio.aspx)

I hope ,You understand that

Regards,

Senthil

  • Comment on Re^2: Link Extracter using Mechanizemodule

Replies are listed 'Best First'.
Re^3: Link Extracter using Mechanizemodule
by Corion (Patriarch) on Aug 26, 2011 at 07:46 UTC

    Then you will need to inspect what ->content gives you and use regular expressions. The link methods of WWW::Mechanize do not deal with arbitrary (unlinked) URLs. They only extract certain tags.

      Hi Corion

      Thank You

      Regards,

      Senthil

Re^3: Link Extracter using Mechanizemodule
by jrowe (Scribe) on Aug 26, 2011 at 13:36 UTC

    Take a look at HTML::Tree::Scanning. Using HTML::TreeBuilder and the look_down method mentioned in the article works well for me.