# fb55/htmlparser2

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/fb55-htmlparser2).**

4,774 stars · 398 forks · TypeScript · MIT

## Links

- GitHub: https://github.com/fb55/htmlparser2
- Homepage: https://feedic.com/htmlparser2
- awesome-repositories: https://awesome-repositories.com/repository/fb55-htmlparser2.md

## Description

htmlparser2 is a collection of tools for high-performance markup parsing, DOM manipulation, and incremental stream processing. It functions as an HTML and XML parser that converts markup strings into structured object trees, alongside a streaming markup parser designed for memory-efficient processing of large documents.

The project includes a DOM manipulation library for querying, modifying, and serializing document object model trees. It also provides a web feed parser to extract structured metadata and entries from RSS, RDF, and Atom feeds.

The library covers broad capabilities in data parsing, including the conversion of documents to DOM trees and the execution of web scraping workflows. These tools allow for the search and modification of parsed document structures before they are converted back into strings.

## Tags

### Part of an Awesome List

- [HTML and XML Parsing](https://awesome-repositories.com/f/awesome-lists/data/html-and-xml-parsing.md) — High-performance library for extracting and processing data from HTML and XML markup documents.
- [DOM Tree Construction](https://awesome-repositories.com/f/awesome-lists/data/html-parsing/dom-tree-construction.md) — Converts markup strings into a structured object tree with support for XML mode and character indices. ([source](https://github.com/fb55/htmlparser2/blob/master/README.md))
- [DOM Manipulation](https://awesome-repositories.com/f/awesome-lists/devtools/dom-manipulation.md) — Provides a suite of tools for parsing and programmatically manipulating HTML/DOM in server-side environments.
- [Incremental Parsing](https://awesome-repositories.com/f/awesome-lists/data/html-and-xml-parsing/xml-parsing/incremental-parsing.md) — Offers incremental parsing of documents using callbacks to process data in chunks. ([source](https://github.com/fb55/htmlparser2/blob/master/README.md))
- [Stream-Based Parsing](https://awesome-repositories.com/f/awesome-lists/data/html-and-xml-parsing/xml-parsing/stream-based-parsing.md) — Provides event-driven parsing for large XML and HTML files to minimize memory consumption. ([source](https://github.com/fb55/htmlparser2/blob/master/README.md))
- [Feed Parsing Libraries](https://awesome-repositories.com/f/awesome-lists/devtools/feed-parsing-libraries.md) — Provides a library for decoding and processing various web feed formats like RSS, RDF, and Atom. ([source](https://github.com/fb55/htmlparser2#readme))
- [Parsing Tools](https://awesome-repositories.com/f/awesome-lists/data/parsing-tools.md) — HTML and XML parser.

### Data & Databases

- [Streaming Parsers](https://awesome-repositories.com/f/data-databases/streaming-parsers.md) — Implements a memory-efficient parser that processes large markup documents incrementally.

### Programming Languages & Runtimes

- [XML and HTML Document Parsers](https://awesome-repositories.com/f/programming-languages-runtimes/string-parsing/xml-and-html-document-parsers.md) — Fast and forgiving parser that converts HTML and XML content into in-memory document trees.

### Software Engineering & Architecture

- [State-Machine Parsers](https://awesome-repositories.com/f/software-engineering-architecture/state-machine-parsers.md) — Uses a state-machine based approach to convert input streams into tokens for complex HTML and XML syntax.
- [Stream-Based Text Processing](https://awesome-repositories.com/f/software-engineering-architecture/stream-based-text-processing.md) — Consumes markup data incrementally through a writable interface to process large documents without full memory loading.
- [DOM Tree Construction](https://awesome-repositories.com/f/software-engineering-architecture/trees/syntax-tree-construction/dom-tree-construction.md) — Transforms a sequence of parsed tokens into a hierarchical Document Object Model for programmatic use.
- [Node Querying](https://awesome-repositories.com/f/software-engineering-architecture/trees/tree-node-reorderers/dom-node-manipulators/node-querying.md) — Provides tools for searching parsed document trees using IDs, tags, and custom filters to retrieve content. ([source](https://github.com/fb55/htmlparser2/blob/master/README.md))
- [Event-Driven Callbacks](https://awesome-repositories.com/f/software-engineering-architecture/event-driven-callbacks.md) — Implements a callback-driven mechanism that triggers events upon encountering specific markup tokens.

### Web Development

- [DOM Manipulation Libraries](https://awesome-repositories.com/f/web-development/dom-manipulation-libraries.md) — Ships a comprehensive toolset for selecting, modifying, and serializing document object model trees.
- [DOM Serialization](https://awesome-repositories.com/f/web-development/dom-serialization.md) — Converts a modified structured document object model back into an HTML or XML string. ([source](https://github.com/fb55/htmlparser2/blob/master/README.md))
- [Web Scraping](https://awesome-repositories.com/f/web-development/web-scraping.md) — Provides the parsing foundations for extracting structured data from websites and web feeds.

### Business & Productivity Software

- [Large Scale XML Processing](https://awesome-repositories.com/f/business-productivity-software/excel-spreadsheet-management/large-scale-xml-processing.md) — Processes massive markup files using streaming and callbacks to avoid high memory usage.

### Content Management & Publishing

- [Syndication Feed Parsers](https://awesome-repositories.com/f/content-management-publishing/syndication-feed-parsers.md) — Extracts structured metadata and entries from RSS, RDF, and Atom syndication feeds.
