C# · Python (Rust & pure) · JavaScript · Go · Rust · Java · PHP · Ruby · C · C++

Parse any page in microseconds

A fast HTML / XML parser for scraping, with XPath 1.0 and CSS selectors. Enter an address: the server loads the page and parses it with z3l.FastHtmlParser. Open the tag tree, run selectors, see the forms and tables it found.

Try:

Click a tag for its text, attributes, CSS path and XPath

body.TextLineBreaks(): the visible text with line breaks for <br>, blocks and paragraphs; scripts, styles and comments left out.


      

Scraping code that reads like the page

Typed tags, CSS selectors or XPath, and chains that never throw. The same API in every language.

  • 1
    A flat list of tags, not a DOMOne pass over the page. Tags hold positions in the source; text and attributes are read when you ask.
  • 2
    XPath 1.0 and CSS selectorsAll axes and functions; CSS up to :has() and :nth-child(An+B of S). Compiled and cached.
  • 3
    Browser rules where they matterOptional end tags, raw text elements, 2125 HTML5 entities, links resolved against the page URL.
  • 4
    Null-safe chainsA missing element gives null at the end of the chain, not an exception.

Everything scraping needs, nothing it doesn't

Fewer CPU cores per crawler, less GC pressure, lower cloud bills.

Fast parsing

One pass, one exact-size list of tags. A 50 KB page parses in about 60 μs; time grows linearly on any markup, broken or hostile.

Forms as a browser sends them new

form.Fields() gives the name / value pairs a browser would submit: hidden __VIEWSTATE, checked boxes, selected options, the clicked button.

Clean text, real entities

Text() gives the visible text; TextLineBreaks() keeps lines and paragraphs. All 2125 HTML5 entities decoded like a browser.

XPath 1.0 and CSS selectors

XPath with all axes, predicates and functions. CSS as querySelectorAll, cross-checked against AngleSharp on every test page.

XML, RSS, Atom, sitemaps

Documents starting with <?xml are parsed by XML rules, so feeds and sitemaps just work.

Thread-safe, no dependencies

A parsed document is read-only: query it from any number of threads. No dependencies in any port; .NET build is trimming and Native AOT compatible.

What it is not. It builds a flat list of tags, not a full DOM: no implicit <tbody>, read-only documents, no JavaScript. For extracting data it finds the same elements, texts and attributes as AngleSharp; the test suite checks this on every saved page.

One parser, ten languages

Every port is written for its language and passes the same conformance data as the .NET original. Python has two packages with one API: fasthtmlparser, a wrapper over the Rust port for speed, and fasthtmlparser-pure, a pure-Python port for places where compiled wheels can't go.

Benchmarks on real pages

BenchmarkDotNet, .NET 10, Intel Xeon E-2236. Shorter is better. In the scraping tasks all three libraries return exactly the same records.

Time

Memory allocated

AngleSharp 1.10.0, HtmlAgilityPack 1.13.1. Every port has its own benchmarks against the native parsers of its platform (selectolax, lxml, BeautifulSoup, cheerio, jsoup, goquery, scraper, Nokogiri, DOMDocument, lexbor, Gumbo): see bench/ in each repository, and the cross-language comparison on dev.to · на Хабре.

Simple, one-time pricing

Free for individuals and small companies. Larger organizations pay once and use it forever, in every language.

Community

Individuals and organizations under USD 1M annual revenue and under 100 employees.

$0 free forever
  • Commercial use included
  • All features, all languages, no limits
  • All future versions
  • Community support on GitHub
Install

No registration, no license key.

Questions

Which language should I pick?

The one your scraper is written in: every port has the same API and the same results.

Which Python package: fasthtmlparser or fasthtmlparser-pure?

Both have the same API and give the same results, so switching is one import. fasthtmlparser wraps the Rust port and is the fastest (5–7x selectolax, 20x lxml); it ships wheels for Linux (glibc and musl), Windows and macOS, x86-64 and ARM64. fasthtmlparser-pure is plain Python with no compiled code: take it for PyPy, AWS Lambda layers without wheels, Pyodide, locked-down machines or anywhere you can't install binaries; it is still 9x faster than BeautifulSoup with html.parser.

try:
    import fasthtmlparser as fh          # Rust inside
except ImportError:
    import fasthtmlparser_pure as fh     # same API, pure Python
Is it a full HTML5 DOM?

No. It builds a flat list of tags with parents, the way scraping needs it, and follows the HTML rules that change what you extract: optional end tags, raw text elements, void elements, entities, XML mode for feeds. It does not insert implicit <tbody> or move misnested tags, and it does not run JavaScript.

What does this demo do with the pages I load?

The server loads the page, parses it and keeps the result in memory for 20 minutes so you can open the tree; nothing is written to disk or logged. Only public http / https addresses are loaded, up to 5 MB.

Do I need a commercial license?

Only if your organization, together with its affiliates, has USD 1,000,000 or more in annual revenue, or 100 or more employees and contractors. Everyone else uses it free, including in commercial products.

Does the library phone home or check a license key?

No. There is no license key, no telemetry and no network access. Licensing is a legal agreement, not a technical lock.

Can we pay by invoice or bank transfer?

Yes. Until card checkout opens, every purchase goes by invoice: write to romanti3172@gmail.com.