CmdID

CmdID / Commands

htmlq

Use CSS selectors to extract content from HTML files. tldr-pages

On several platforms

Opens CmdID with your command. It is read in your browser and sent nowhere.

Several platforms

from tldr-pages, CC BY 4.0

Return all elements of class card

cat path/to/file.html | htmlq '.card'Identify

Get the text content of the first paragraph

cat path/to/file.html | htmlq --text 'p:first-of-type'Identify

Find all the links in a page

cat path/to/file.html | htmlq --attribute href 'a'Identify

Remove all images and SVGs from a page

cat path/to/file.html | htmlq --remove-nodes 'img' --remove-nodes 'svg'Identify

Pretty print and write the output to a file

htmlq --pretty --filename path/to/input.html --output path/to/output.htmlIdentify