Filter HTML With pup
Select, transform and print HTML nodes using a compact query language.
Run curl -s https://example.com | pup 'title text{}' to print the title text.
01Command
Command
$ curl -s https://example.com | pup 'title text{}'02What it does
pup implements a small selector language with functions such as text{} and attr{href} to extract exactly the field you want. It is useful for scraping static pages in shell scripts without a full programming language.
03Risk
!Warning: The project is less actively maintained than htmlq; verify element handling on complex pages.
04Undo
✓No undo needed — this command does not change persistent state.
05Sources
- Homebrew formula: pupEvidence: CLI companion with 200+ commands across 33+ Datadog products. Packages pup, a command-line HTML parser with a CSS-selector-like filter language.
- Official project documentationEvidence: Packages pup, a command-line HTML parser with a CSS-selector-like filter language.
Last verified: 2026-09-22 · Category: Developer