The fast & forgiving HTML and XML parser
htmlparser2 is a fast and forgiving HTML and XML parser written in JavaScript. The project provides a callback-based interface for parsing documents with minimal memory allocations, and includes helper functions for building and querying DOM trees, serializing modified documents back to HTML, and parsing RSS, RDF, and Atom feeds. It is part of an ecosystem that includes related tools like domhandler, domutils, css-select, cheerio, and dom-serializer for more ergonomic DOM manipulation and querying. According to benchmarks, htmlparser2 is the fastest HTML parser available, though it prioritizes speed over strict HTML specification compliance.