# fb55/htmlparser2

The fast & forgiving HTML and XML parser

Repository: https://github.com/fb55/htmlparser2
Canonical: https://ross.abutalabs.com/products/htmlparser2
Homepage: https://feedic.com/htmlparser2
Language: TypeScript
License: MIT
License Family: permissive
Topics: html-parser, javascript, dom, htmlparser2, html, xml, parser
Last push: 2026-08-25T12:45:26+00:00

## Health v2 (maintenance only)
Score: 87/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 99, release rhythm 63, longevity 100
- inputs: {"age_days": 5485, "days_push": 8, "days_rel": 166, "gap_med": 56, "n_releases_24m": 4}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 4788, forks 402 (observed 2026-08-28T04:08:59.840064+00:00)

## What it is
htmlparser2 is a fast, forgiving HTML and XML parser for JavaScript and TypeScript, offering a low-allocation callback interface as well as DOM output via its ecosystem packages. It prioritizes speed over strict HTML spec compliance, making it the engine behind tools like cheerio.

## Use cases
- parse html from web pages in node
- extract links and text from html documents
- parse xml feeds like rss and atom
- scrape websites with cheerio-style selectors
- stream-parse large html documents with minimal memory
- build a dom tree from malformed html

## When to choose
- you need the fastest html/xml parsing in javascript
- input html may be malformed or non-spec-compliant
- you want a streaming, low-allocation callback-based parser
- you are building scraping or feed-processing tools

## When to avoid
- you need strict HTML5 spec compliance and error correction (use parse5)
- you need a full browser-grade DOM with CSS selector querying out of the box

## Facets
- artifact type: library
- maturity: stable
- function: parser, web-scraping
- domain: parsers, web-development, developer-tools
- platform: browser, cross-platform
- tags: html-parser, xml-parser, dom, streaming, forgiving-parser, typescript, nodejs

## Member repositories
- fb55/htmlparser2 (main) score 87

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:08:59.840064+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T18:18:41.772642+00:00, confidence not recorded.
  - readme: https://github.com/fb55/htmlparser2 (fetched 2026-08-28T04:08:59.840064+00:00, sha 75f7b020d681)
  - homepage: https://feedic.com/htmlparser2 (fetched 2026-08-29T09:02:07.394026+00:00, sha b0f1ea9925b0)
  - registry_npm: https://registry.npmjs.org/htmlparser2 (fetched 2026-08-29T09:02:07.403234+00:00, sha 6e4636685b15)
- Data as of 2026-08-30T08:39:29.467469+00:00.
