This example extracts all links from a document. It will print one line for each link, containing the URL and the textual description between the <A>...</A> tags: use HTML::TokeParser; $p = HTML::TokeParser->new(shift||"index.html"); while (my $token = $p->get_tag("a")) { my $url = $token->[1]{href} || "-"; my $text = $p->get_trimmed_text("/a"); print "$url\t$text\n"; }
In reply to Re: Filter Links in HTML-documents
by ichimunki
in thread Filter Links in HTML-documents
by stefan k
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |