With XML::LibXML, it would be
for my $node ($doc->findnodes('//*[@class="className"]')) { print($node->toString()); }
If you want to use HTML::Parser (e.g. if the HTML isn't valid), don't use it directly. Use HTML::TreeBuilder instead. It creates a tree of HTML::Element objects, whose look_down and as_HTML method you could use.
In reply to Re: Parsing semi-complex HTML
by ikegami
in thread Parsing semi-complex HTML
by jupe
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |