htmlq
Use CSS selectors to extract content from HTML files. More information: https://github.com/mgdm/htmlq#usage.
- Return all elements of class
card:
cat | htmlq '.card'
- Get the text content of the first paragraph:
cat | htmlq 'p:first-of-type'
- Find all the links in a page:
cat | htmlq href 'a'
- Remove all images and SVGs from a page:
cat | htmlq 'img' 'svg'
- Pretty print and write the output to a file:
htmlq
来源:tldr-pages contributors · 作者与贡献记录 · CC BY 4.0。离线整理了版式、链接和媒体显示。
