loading
loading
Utilities
CSS selectors over HTML, the jq counterpart for markup.
overview
pup is the extraction slot after a page fetch. Pass an HTML file and a CSS selector expression; it returns matching nodes, text{}, or attr{href} values as a flat list.
Reach for it when regex against raw markup is brittle. Selectors like a[href], td, or :contains keep only the elements the next stage needs.
Trickest runs pup as a managed Utilities node: HTML file and selector in, file and folder out. Prefer jq or gron for JSON; unfurl when you already have URLs.
source github.com/ericchiang/pup
use cases
Select a[href] and ask for attr{href} so pup returns a clean list of links from a page, ready for a crawler or prober downstream.
Target the right td or row with a CSS selector and emit text{} to turn a results table into a flat list the workflow can consume.
Use a precise selector to grab only the elements you want, avoiding brittle regular expressions against raw markup.
Combine :contains with text{} to keep only cells or nodes that mention a domain such as example.com before the next stage runs.
reference
| Name | Type | Flag | Description |
|---|---|---|---|
| file | FILE | · | Input HTML file to process. |
| input | STRING | · | Selector expression, e.g. td :contains(".example.com") text{}. |
Showing key inputs. pup exposes 2 inputs in total.
example
# extract hrefs from a saved HTML page (pup reads stdin)# pup selector: a attr{href}cat page.html | pup 'a attr{href}'https://www.example.com/https://api.example.com/v1/statushttps://app.example.com/loginhttps://dev.example.com/healthhttps://staging.example.com/docshttps://cdn.example.net/assets/app.jshttps://static.example.org/logo.svgguidance
Use pup when you have HTML and need specific elements via CSS selectors, the way jq pulls fields from JSON. It parses pages; it does not fetch them. Run a request stage first. Prefer jq or gron for JSON payloads.
Flattens JSON into greppable lines. JSON-side counterpart to pup HTML extraction.
Pulls structured pieces out of URLs. Use when you already have links, not raw HTML.
Crawls and extracts links, secrets, and endpoints in one pass. Heavier than a pure selector step.
faq
related
Spider a URL and return a wordlist for password crackers.
Wordlist and mined-word subdomain permutation.
Import, export, and upsert workflow data against an Airtable base.
Decode Android APK files into smali sources and resources.
Check a file's values against conditions and exit with a matching code.
Authenticated Route53 hosted-zone inventory.
An HTML page feeds pup, which selects the links with a CSS selector and hands them to httpx to probe before the live links land as output.
Facts on this page come from the live Trickest tool library.