use strict;
use warnings;
use HTML::TokeParser;
my @sections = qw/ Poster Date /;
my $p = HTML::TokeParser->new( 'test.html' );
while ( my $token = $p->get_token ) {
my ( $type, $text ) = @$token;
if ( $type eq 'C' ) {
# we have an HTML comment
foreach my $section ( @sections ) {
if ( $text =~ /$section/ ) {
$p->get_tag( "b" );
my $data = $p->get_trimmed_text;
print "$data\n";
last;
}
}
}
}