node package manager
Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »



Build Status

screen scrape from command line with xpath or css selectors

Getting Started

Install the module with: npm install -g cli-scrape

Then try out the following:

$ scrape '//p[0]/text()'
$ scrape 'p:first-child'

Or some of these:

# get a list of all of my public repos from github
$ scrape 'li.public.source h3 a'
# Check if a website is down via down for everyone or just me:
$ scrape '/html/body//div[@id="container"]/text()' | head -n 1
It's just you.
$ scrape '/html/body//div[@id="container"]/text()' | head -n 1
It's not just you!
# Or make it a shell function:
function justme() {
    scrape$1 '/html/body//div[@id="container"]/text()' | head -n 1
# Then run it like so:
$ justme
It's just you
$ justme
It's not just you!


In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using grunt.

Release History

  • 0.1.9 - Initial release
    • Supports XPath queries via google's wicked fast xpath library
    • Supports css selector queries using qwery


Copyright (c) 2012 pthrasher
Licensed under the MIT license.