Fast & Forgiving HTML/XML Parser
JSON →htmlparser2 is a high-performance, event-driven HTML/XML parser for JavaScript and TypeScript environments. It is currently at stable version 12.0.0 and maintains an active release cadence with frequent updates, often aligning with WHATWG specifications. The library prioritizes speed and efficiency, making it suitable for tasks like web scraping, content transformation, and processing RSS/Atom feeds. While fast and forgiving, it takes some shortcuts compared to strictly spec-compliant parsers like `parse5`, which might lead to different parsing results for highly malformed HTML. It integrates with an ecosystem of related packages like `domhandler` for DOM construction and `css-select` for querying.
Traffic · last 30 days ↑150% vs prev 7d
top countries 🇺🇸 United States · 🇩🇪 Germany · 🇨🇦 Canada · 🇫🇮 Finland