Filter HTML by CSS Selector.
npm install dom-extract -g
Select all h1 from index.html
selector='h1'
file='index.html'
dom-extract $selector $file
Use with find and xargs to get all title tags, out of *.html files.
find . -name "*.html" | xargs -L 1 dom-extract 'title'
Pipe HTML from direct STDIN
cat index.html | dom-extract 'title'
Extract Number of Followers from Twitter Username
curl -sk https://twitter.com/philpoore | dom-extract ".ProfileNav-item--followers .ProfileNav-value" --text
- Allow pipe from STDIN
Bump Version
Bump Version
Bump Version
- Added support for using as libary
- Extended the cli to include showing innerHTML
- Added Testing
- Update README.md
- Added support for --attr option
- Fixed bug with sticky options for extract
- Fixed typo
Phil Poore made this :P