HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
EmilStenstrom
justhtml
Python2025–2026
EmilStenstrom / justhtml

justhtml

A pure Python HTML5 parser that just works. No C extensions to compile. No system dependencies to install. No complex API to learn.

6Distinct people
11Mentions
0Explicit recommenders
1.2KGitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

A pure Python HTML5 parser that just works. No C extensions to compile. No system dependencies to install. No complex API to learn.

GitHub

Where it is used

No documented product use has been verified yet.

What people are saying

No recommendation phrase was found in the indexed comments.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

No other repository is repeatedly linked in the same discussions.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 3:56:07 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by week11 dated mentions

Observed mentions: 2025-12-02 18:19:40 UTC to 2026-05-31 11:24:13 UTC. Weeks start Monday, UTC.

012342025-12-01 00:00:00 UTC to 2025-12-08 00:00:00 UTC (exclusive): 1 mentions; 1 submissions, 0 commentsDec 12025-12-08 00:00:00 UTC to 2025-12-15 00:00:00 UTC (exclusive): 3 mentions; 0 submissions, 3 comments2025-12-15 00:00:00 UTC to 2025-12-22 00:00:00 UTC (exclusive): 4 mentions; 1 submissions, 3 comments2025-12-22 00:00:00 UTC to 2025-12-29 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2025-12-29 00:00:00 UTC to 2026-01-05 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2026-01-05 00:00:00 UTC to 2026-01-12 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2026-01-12 00:00:00 UTC to 2026-01-19 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2026-01-19 00:00:00 UTC to 2026-01-26 00:00:00 UTC (exclusive): 1 mentions; 1 submissions, 0 comments2026-01-26 00:00:00 UTC to 2026-02-02 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2026-02-02 00:00:00 UTC to 2026-02-09 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2026-02-09 00:00:00 UTC to 2026-02-16 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2026-02-16 00:00:00 UTC to 2026-02-23 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2026-02-23 00:00:00 UTC to 2026-03-02 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 commentsFeb 232026-03-02 00:00:00 UTC to 2026-03-09 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2026-03-09 00:00:00 UTC to 2026-03-16 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2026-03-16 00:00:00 UTC to 2026-03-23 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2026-03-23 00:00:00 UTC to 2026-03-30 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2026-03-30 00:00:00 UTC to 2026-04-06 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2026-04-06 00:00:00 UTC to 2026-04-13 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2026-04-13 00:00:00 UTC to 2026-04-20 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2026-04-20 00:00:00 UTC to 2026-04-27 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2026-04-27 00:00:00 UTC to 2026-05-04 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2026-05-04 00:00:00 UTC to 2026-05-11 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2026-05-11 00:00:00 UTC to 2026-05-18 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2026-05-18 00:00:00 UTC to 2026-05-25 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2026-05-25 00:00:00 UTC to 2026-06-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 commentsMay 25

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
Dec 12025-12-01 00:00:00 UTC2025-12-08 00:00:00 UTC110
Dec 82025-12-08 00:00:00 UTC2025-12-15 00:00:00 UTC303
Dec 152025-12-15 00:00:00 UTC2025-12-22 00:00:00 UTC413
Dec 222025-12-22 00:00:00 UTC2025-12-29 00:00:00 UTC000
Dec 292025-12-29 00:00:00 UTC2026-01-05 00:00:00 UTC000
Jan 52026-01-05 00:00:00 UTC2026-01-12 00:00:00 UTC000
Jan 122026-01-12 00:00:00 UTC2026-01-19 00:00:00 UTC101
Jan 192026-01-19 00:00:00 UTC2026-01-26 00:00:00 UTC110
Jan 262026-01-26 00:00:00 UTC2026-02-02 00:00:00 UTC000
Feb 22026-02-02 00:00:00 UTC2026-02-09 00:00:00 UTC000
Feb 92026-02-09 00:00:00 UTC2026-02-16 00:00:00 UTC000
Feb 162026-02-16 00:00:00 UTC2026-02-23 00:00:00 UTC000
Feb 232026-02-23 00:00:00 UTC2026-03-02 00:00:00 UTC000
Mar 22026-03-02 00:00:00 UTC2026-03-09 00:00:00 UTC000
Mar 92026-03-09 00:00:00 UTC2026-03-16 00:00:00 UTC000
Mar 162026-03-16 00:00:00 UTC2026-03-23 00:00:00 UTC000
Mar 232026-03-23 00:00:00 UTC2026-03-30 00:00:00 UTC000
Mar 302026-03-30 00:00:00 UTC2026-04-06 00:00:00 UTC000
Apr 62026-04-06 00:00:00 UTC2026-04-13 00:00:00 UTC000
Apr 132026-04-13 00:00:00 UTC2026-04-20 00:00:00 UTC000
Apr 202026-04-20 00:00:00 UTC2026-04-27 00:00:00 UTC000
Apr 272026-04-27 00:00:00 UTC2026-05-04 00:00:00 UTC000
May 42026-05-04 00:00:00 UTC2026-05-11 00:00:00 UTC000
May 112026-05-11 00:00:00 UTC2026-05-18 00:00:00 UTC000
May 182026-05-18 00:00:00 UTC2026-05-25 00:00:00 UTC000
May 252026-05-25 00:00:00 UTC2026-06-01 00:00:00 UTC101

What Hacker News says

11 sources
This is a great blog and an incredible piece of research. Re-reading again today, makes me think of Emil Stenström's recently effort to use an LLM to write an HTML5 parser in pure Python [1] using the official HTML5 spec and their test cases. [2] Later, Simon Willison used an LLM to convert the pure Python source to JavaScript. [3] It seems reasonable to ask an LLM to write a "perfect" JSON parser given the RFC spec and massive test pack from seriot.ch. Regarding the "minefield" of JSON parsing, I used to lean on Google's Gson (Java) a lot in my early days. I thought Jackson FasterXML was "too complex". Later, I realised the mind-boggling number of configuration options was weirdly more sustainable (but more complex!), because I could carefully control each JSON parser/generator edge case. [1] https://github.com/EmilStenstrom/justht
Read the rest
In wolfSSL releases a new product; wolfCOSE a zero alloc C embbedded COSE stack
I think it's fair enough to consider porting a subset of rewriting, in which case there are several successful experiments out there: - JustHTML [1], which in practice [2] is a port of html5ever [3] to Python. - justjshtml, which is a port of JustHTML to JavaScript :D [4]. - MiniJinja [5] was recently ported to Go [6]. All three projects have one thing in common: comprehensive test suites which were used to guardrail and guide AI. References: 1. https://github.com/EmilStenstrom/justhtml 2. https://friendlybit.com/python/writing-justhtml-with-coding-... 3. https://github.com/servo/html5ever 4. https://simonwillison.net/2025/Dec/15/porting-justhtml/ 5. https://github.com/mitsuhiko/minijinja 6. https://lucumr.pocoo.org/2026/1/14/minijinja-go-port/
In Cursor's latest “browser experiment” implied success without evidence
Hi! The expected errors are not standardized enough for it to make sense to enable --check-errors by default. If you look at the readme, you'll see that the only thing they're checking is that the _numbers of errors_ are correct. That said, the example you are pulling our out does not match that either. I'll make sure to fix this bug and other like it! https://github.com/EmilStenstrom/justhtml/issues/20
In How I wrote JustHTML, a Python-based HTML5 parser, using coding agents
I mean the design of the user-facing API: https://github.com/EmilStenstrom/justhtml/blob/main/docs/api... See also the demo app I vibe-coded against their library here: https://tools.simonwillison.net/justhtml - that's what initially convinced me that the API design was good. I particularly liked the design of JustHTML's core DOM node: https://github.com/EmilStenstrom/justhtml/blob/main/docs/api... - and the design of the streaming API: https://github.com/EmilStenstrom/justhtml/blob/main/docs/api...
In I ported JustHTML from Python to JavaScript with Codex CLI and GPT-5.2 in hours
This seems really impressive. I am too lazy to replicate this, but I do wonder how important the test suite is for a a port that likely uses straight forward, dependency free python code https://github.com/EmilStenstrom/justhtml/tree/main/src/just... It is enormously useful for the author to know that the code works, but my intuition is if you asked an agent to port files slowly, forming its own plan, making commits every feature, it would still get reasonably close, if not there. Basically, I am guessing that this impressive output could have been achieved based on how good models are these days with large amounts of input tokens, without running the code against tests.
In I ported JustHTML from Python to JavaScript with Codex CLI and GPT-5.2 in hours
I just had Codex CLI figure out where that first version ended and the new one began. It looks to me like this is the last commit before the rewrite: https://github.com/EmilStenstrom/justhtml/tree/989b70818874d... The commit after that is https://github.com/EmilStenstrom/justhtml/commit/7bab3d2 "radical: replace legacy TurboHTML tree/handler stack with new tokenizer + treebuilder scaffold" It also adds this document called html5ever_port_plan.md: https://github.com/EmilStenstrom/justhtml/blob/7bab3d22c0da0... Here's the Codex CLI transcript I used to figure this out: https://gistpreview.github.io/?53202706d137c82dce87d729263df...
In How I wrote JustHTML, a Python-based HTML5 parser, using coding agents
JustHTML https://github.com/EmilStenstrom/justhtml is a neat new Python library - it implements a compliant HTML5 parser in ~3,000 lines of code that passes the full existing 9,200 test HTML5 conformance suite. Emil Stenström wrote it with a variety of coding agent tools over the course of a couple of months. It's a really interesting case study in using coding agents to take on a very challenging project, taking advantage of their ability to iterate against existing tests. I wrote a bit more about it here: https://simonwillison.net/2025/Dec/14/justhtml/
In How I wrote JustHTML, a Python-based HTML5 parser, using coding agents
I just shipped a new one of these a few minutes ago (from my phone). I found out about a new Python HTML parsing library - https://github.com/EmilStenstrom/justhtml - and wanted to try it out but I'm out without my laptop. So I had Claude Code for web build me a playground interface for trying it out: https://tools.simonwillison.net/justhtml It loads the Python library using Pyodide and lets you try it out with a simple HTML UI. The prompts I used are in this PR: https://github.com/simonw/tools/pull/156
In Useful patterns for building HTML tools

Show HN: JustHTML – A pure Python HTML5 parser that just works

I got frustrated with HTML parsing in Python. I wanted a Python HTML parser that was both correct and easy to install. The C-based ones (lxml, selectolax) are fast but not HTML5 compliant. The pure Python ones (html.parser, BeautifulSoup's default) are easy to install but choke on real-world HTML. html5lib is 80% correct but painfully slow. So I wrote JustHTML. It's: • 100% HTML5 compliant – passes all 8,500+ html5lib tests. If a browser can parse it, JustHTML can. • Pure Python, zero dependencies – pip install and go. Works on PyPy, Pyodide, anywhere. • Fast enough – ~0.1s to parse Wikipedia's homepage. Not C-fast, but 50% faster than html5lib. • Simple API – doc.query("div.foo > p") with CSS selectors. One method to learn. Example: from justhtml import JustHTML doc = JustHTML("<div><p class='intro'>Hello!</p></div>") print(doc.que
Read the rest
ry(".intro")[0].to_html()) I've fuzz-tested it with 3 million malformed documents. Would love feedback, especially on the API design.
6 points · Open discussion

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.