HTML-Tree is a Perl library for parsing HTML into DOM-like trees. It includes HTML::TreeBuilder and HTML::Element.