- or download this
use HTML::TokeParser::Simple;
my $p = HTML::TokeParser::Simple->new( $somefile );
...
next if ! $token->is_text;
print $token->return_text;
}
- or download this
use HTML::TokeParser::Simple;
use HTML::Tagset;
...
exists $HTML::Tagset::isKnown{ $token->return_tag };
print $token->return_text;
}
- or download this
$token->is_end_tag( '/form' );
$token->is_end_tag( 'form' );
- or download this
while ( my $token = $p->get_token ) {
# the following would skip <p>, but not <pr>
next if $token->is_valid_tag;
print $token->return_text;
}
- or download this
if ( $token->can_link ) {
# check to see if it's really linking to something
}
- or download this
$token->is_head_element;
$token->is_table_element;
$token->is_body_element;
# etc.
- or download this
$token->return_attr;
# becomes
...
$token->return_text;
# becomes
$token->text;