[an error occurred while processing this directive]

Как на Perl правильно выделить все A HREF ссылки из HTML файла.
use HTML::TokeParser;
my $p = HTML::TokeParser->new("index.html");
if ($p->get_tag("title")){
   my $title = $p->get_trimmed_text; # Содержимое <title>
}
while (my $token = $p->get_tag("a")) {  # перибираем все <a href>
   my $url = $token->[1]{href} || "";
   my $text = $p->get_trimmed_text("/a"); # Текст между <a ...> и </a>
}
 
08.04.2003
Ключи: html, parser, file, tex, loop, text, perl / Лицензия: CC-BY
Раздел:    Корень / Программисту и web-разработчику / Perl / Полезные подпрограммы на Perl / Подпрограммы для WEB

[an error occurred while processing this directive]

[an error occurred while processing this directive]