Giter Site home page Giter Site logo

node-nom's Introduction

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 <[email protected]>

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.

node-nom's People

Contributors

matthewmueller avatar

Stargazers

 avatar zabuza225 avatar Ayan Yenbekbay avatar C.J. Winslow avatar Angus H. avatar Martin Bazik avatar Bogdan Mustata avatar Sebastian Schubotz avatar Todd Bashor avatar James Nylen avatar  avatar Abe Massry avatar Steve Melrose avatar JT5D avatar Martin Frojd avatar James J. Womack avatar Tarun Chaudhry avatar Jan Buschtöns avatar Nazeeruddin Ikram avatar der_On avatar Fredrik Forsmo avatar Alexandru Vlăduţu avatar Paul Vollmer avatar Fraser Xu avatar Mike Vegeto avatar Seth Vincent avatar Lance Pollard avatar Julian Gruber avatar M∎∎r avatar Ivo Georgiev avatar Fernando Abellán avatar Jan-Christoph Lohmann avatar Tad Lispy avatar Bernard Debecker avatar Cecil du Toit avatar Jason Morganson avatar Vaughan Rouesnel avatar thadclay avatar Larron Armstead avatar Adrian Statescu avatar Erhan Gundogan avatar  avatar Wesley Lauka avatar Matt Smith avatar Mike Guterl avatar Ramiro Romero Arjona avatar Ryan avatar Lari Hoppula avatar Rob Dodson avatar NOOB avatar Bevan Hunt avatar Ilya Tsuryev avatar Patrick Arminio avatar Erik Allais avatar Alejandro Morales avatar Nicolas Barbotte avatar Goran Gajic avatar Olivier Vaillancourt avatar Andy Hiew avatar Yavuz Ege Özcan avatar robbi5 avatar Sergey Maskalik avatar André Caron avatar Elvis Luciano Guimarães avatar Robby Valles avatar Gergely Imreh avatar Joe Pestro avatar Evan avatar Seggy Umboh avatar Les Orchard avatar Fabrizio Codello avatar Marcello Prattico avatar Filipe A Moreira avatar Robert Malko avatar

Watchers

Gergely Imreh avatar Rafal Zajac avatar Ash avatar James Cloos avatar  avatar

node-nom's Issues

Cannot read property 'ok' of null

I setup a basic example and i'm getting this errorI, seems like its not returning a response so the property isn't available. It was complaining about my node version being too new which kind of made me feel like that's the culprit. It was saying wanted node 0.6.0, any ideas?

nom cli fails to fetch meta

nom url 'meta[http-equiv="refresh"]' does not fetch anything even though the url has few many meta tags, but nom url 'head' works fine.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.