It executes without error now but it doesn't find any heading tags. I kept all other $htm5 as the same after I changed all instances to $tkn and having it error out again.
Thanks.use warnings; use strict; use LWP::Simple; my $url = "my $url = "http://www.w3schools.com/html/html_primary.asp"; +"; # this has lots of <h#> tags my $src = get($url); my $headtags = ''; use HTML::TokeParser::Simple; my $htm5 = HTML::TokeParser::Simple->new(\$src); while ( my $tkn = $htm5->get_token ) { if ($tkn->is_start_tag( qr/^h[123456]$/ )) { next if (!$htm5->get_text); $headtags= $headtags . " " . $htm5->get_text; } } print "HEAD TAGS: $headtags\n\n\n\n"
In reply to Re^2: is_start_tag not on tokeparser simple
by Anonymous Monk
in thread is_start_tag not on tokeparser simple
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |