7,583 stars · MIT (read from /blob/master/LICENSE.md after /blob/master/LICENSE returned 404; plain unmodified text, "Copyright (c) 2019 Michael Maclean") · v0.4.0 (2022-01-03 — THE YEAR TRAP: the GitHub page shows "03 Jan" with no year, which read forward is this year, and crates.io settled it as 3 January 2022, four years and nine months ago. The SECOND-LARGEST date error in this archive after ta-lib's nine years) · Track this in Scout
Pulls parts out of an HTML page using CSS selectors, the way a JSON query tool pulls parts out of JSON.
▶Repo detailsthe review · specs · pros & cons · install
What it is
htmlq reads HTML on its input, applies a CSS selector, and prints the matching elements, their text, or one of their attributes. It is a single Rust program with no server and no configuration.
What it is good for. Anyone who checks a page from a script: watching a published version number, pulling the links out of an index page, extracting a table into something a spreadsheet can read. The situation it fits is a page that has no API and no feed.
- MIT, read from the file at
/blob/master/LICENSE.mdafter/blob/master/LICENSEreturned not-found. Plain unmodified text, "Copyright (c) 2019 Michael Maclean". - It pairs directly with
curlon one side andjqon the other, so it slots into pipelines that already exist. - Code was pushed on 27 May 2026.
- The release is four years and nine months old, and this is the second-largest date error this archive has recorded. The GitHub page shows v0.4.0 as "03 Jan" with no year. Read forward, that is this year. The crates.io registry settled it: 3 January 2022. So the binary that installs is more than four years behind the code on the main branch. The project is not dead — the code moved five months ago — but what you install is old.
cargo install htmlqneeds a Rust toolchain installed first, and the README never says so.- 37 open issues and 6 unmerged pull requests on a one-maintainer tool. It reads and prints; it cannot log in, wait for JavaScript, or follow pagination.
- ericchiang/pup
The Go program that did this first and is still widely recommended, but it has taken no code since 2 May 2024.
Track this in Scout - benibela/xidel
Far more powerful, with XPath, XQuery and the ability to follow links and submit forms, and correspondingly much more to learn.
Track this in Scout
brew install htmlq pkg install htmlq scoop install htmlq cargo install htmlq # needs Rust installed first
