Options (6)
-t, --textbooleanGet the text content of the first paragraph
Example:
cat {{path/to/file.html}} | htmlq {{[-t|--text]}} 'p:first-of-type'-a, --attributebooleanFind all the links in a page
Example:
cat {{path/to/file.html}} | htmlq {{[-a|--attribute]}} href 'a'-r, --remove-nodesbooleanRemove all images and SVGs from a page
Example:
cat {{path/to/file.html}} | htmlq {{[-r|--remove-nodes]}} 'img' {{[-r|--remove-nodes]}} 'svg'-p, --prettybooleanPretty print and write the output to a file
Example:
htmlq {{[-p|--pretty]}} {{[-f|--filename]}} {{path/to/input.html}} {{[-o|--output]}} {{path/to/output.html}}-f, --filenamebooleanPretty print and write the output to a file
Example:
htmlq {{[-p|--pretty]}} {{[-f|--filename]}} {{path/to/input.html}} {{[-o|--output]}} {{path/to/output.html}}-o, --outputbooleanPretty print and write the output to a file
Example:
htmlq {{[-p|--pretty]}} {{[-f|--filename]}} {{path/to/input.html}} {{[-o|--output]}} {{path/to/output.html}}Examples (5)
Get the text content of the first paragraph
Remove all images and SVGs from a page
Pretty print and write the output to a file
htmlq [-p|--pretty] [-f|--filename] path/to/input.html [-o|--output] path/to/output.htmlmade by @shridhargupta | data from tldr-pages