GitXplorerGitXplorer
m

node-nom

public
74 stars
2 forks
3 issues

Commits

List of commits on branch master.
Unverified
3e7bf643b14fb06d1e43cd36fc9993dd82b04c58

update package installation

mmatthewmueller committed 9 years ago
Unverified
83a7decfec1bb91872e1a4c85f83589fa4c1d751

Merge branch 'master' of github.com:MatthewMueller/nom

mmatthewmueller committed 12 years ago
Unverified
43c8024b4d19f7cda2f34658ba4dac2dabee2370

bin now returns outer html

mmatthewmueller committed 12 years ago
Unverified
42c53a09ab1d695c16dcb0dccf60d06c715afdcb

Update Readme.md

mmatthewmueller committed 12 years ago
Unverified
c622fc1e0d5f016e4dc7d97c7deb504b9424531b

Merge branch 'master' of github.com:MatthewMueller/nom

mmatthewmueller committed 12 years ago
Unverified
61c000e90cbaa0ceb5d66ca8f3b3f8f51441da74

updated node version, use process.stdout instead of console.log

mmatthewmueller committed 12 years ago

README

The README file for this repository.

nom

Om nom nom. Super simple asynchronous screen scrapper for Node.js. Nom uses cheerio to provide the core jQuery API for grabbing and manipulating the response.

Installation

npm install matthewmueller/nom

Usage

Basic

nom('http://google.com', function(err, $) {
  $('title').text() // => "Google"
});

Multiple Requests

nom('http://google.com', 'http://apple.com', function(err, $g, $a) {
  $g('title').text(); // => Google
  $a('title').text(); // => Apple
});

Another way...

function apple(err, $) {
  $('title').text(); // => Google
}

function google(err, $) {
  $('title').text(); // => Apple
}

// Request currying
nom('http://google.com', google)
   ('http://apple.com', apple);

Command Line Usage

$ nom <url> [selector] 

Arguments:

  • url: website you'd like to request
  • selector: id, class, attribute or any other soupselect compatible selector

Example

$ nom http://google.com title

License

(The MIT License)

Copyright (c) 2012 Matthew Mueller <mattmuelle@gmail.com>

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.