Filter HTML With pup

Select, transform and print HTML nodes using a compact query language.

macOShtmltextparsingLow risk
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

RiskLow risk
CompatibilitymacOS with Homebrew installed
!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: pup
    Homebrew · vendor-doc · 2026-09-20
    Evidence: 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 documentation
    Official project · vendor-doc · 2026-09-20
    Evidence: Packages pup, a command-line HTML parser with a CSS-selector-like filter language.

Last verified: 2026-09-22 · Category: Developer

06Related solutions