You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
501 B
Plaintext

7 years ago
# pup
#
# Command line too for processing HTML
# Reading from stdin, pup prints to stdout, allowing the user to filter parts
# of the page using CSS selectors.
7 years ago
# Install pup. Requires `go`.
7 years ago
go install github.com/ericchiang/pup
# Indent and colorize HTML.
7 years ago
cat file.html | pup --color
# Filter by tag.
7 years ago
cat file.html | pup 'title'
# Pseudoclass: filter by content "History".
7 years ago
cat file.html | pup ':contains("History")'
# Multiple groups of selectors.
7 years ago
cat file.html | pup 'title, h1 span[dir="auto"]'