Hi - I'm very new to Perl and strugling to figure out how you can parse and extract html content from tags with specific attributes.
So far I have this:
my $parser = HTML::TokeParser->new(\$content) ||
die "Could not parse page";
while ($parser->get_tag("b")) {
print $parser->get_text(), "\n";
}
which returns the content of all <b> tags from the target file, but what I need is for it to only return the content from <b> tags which have a specific class, say <b class="total"> for example - so far everything I've tried has failed - any help would be greatly appreciated :0)
So far I have this:
my $parser = HTML::TokeParser->new(\$content) ||
die "Could not parse page";
while ($parser->get_tag("b")) {
print $parser->get_text(), "\n";
}
which returns the content of all <b> tags from the target file, but what I need is for it to only return the content from <b> tags which have a specific class, say <b class="total"> for example - so far everything I've tried has failed - any help would be greatly appreciated :0)