in reply to Using HTTP::LinkExtor to get URL and description info

I think you want HTML::LinkExtor..
use strict; use HTML::LinkExtor; my $p = HTML::LinkExtor->new(\&cb, "http://www.perl.org/"); sub cb { my($tag, %links) = @_; print "$tag @{[%links]}\n"; } $p->parse_file("index.html");

Replies are listed 'Best First'.
Re: Re: Using HTTP::LinkExtor to get URL and description info
by Popcorn Dave (Abbot) on Aug 08, 2002 at 20:18 UTC
    I know that I got the module name wrong, but for what I want to do, HTML::LinkExtor doesn't go far enough.

    My app filters out headlines but I want the active link and the text description. As far as I can tell from playing with HTML::LinkExtor, all I can get is the link, not the text and the link. I couldn't work out how you would pull the link text as it has no anchor tag.

    HTML::TokeParser seems to be the best way for me to go for my project. However if I've missed something with HTML::LinkExtor, let me know and I'll take another look at that.

    Some people fall from grace. I prefer a running start...