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
21 lines
501 B
Plaintext
# 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.
|
|
|
|
# Install pup. Requires `go`.
|
|
go install github.com/ericchiang/pup
|
|
|
|
# Indent and colorize HTML.
|
|
cat file.html | pup --color
|
|
|
|
# Filter by tag.
|
|
cat file.html | pup 'title'
|
|
|
|
# Pseudoclass: filter by content "History".
|
|
cat file.html | pup ':contains("History")'
|
|
|
|
# Multiple groups of selectors.
|
|
cat file.html | pup 'title, h1 span[dir="auto"]'
|