Giter Site home page Giter Site logo

node-crawler's Introduction

node-crawler

How to install

$ npm install crawler

How to test

$ node test/simple.js
$ node test/testrunner.js

Why / What ?

For now just check my lightning talk slides

Help & Forks welcomed! This is just starting for now.

Rough todolist :

  • Make Sizzle tests pass (jsdom bug? https://github.com/tmpvar/jsdom/issues#issue/81)
  • More crawling tests
  • Document the API
  • Get feedback on featureset for a 1.0 release (option for autofollowing links?)
  • Check how we can support other mimetypes than HTML
  • Add+test timeout parameter
  • Option to wait for callback to finish before freeing the pool resource (via another callback like next())
  • Events on queue empty / full

API

var Crawler = require("node-crawler").Crawler;

var c = new Crawler({
    "maxConnections":10,
    "callback":function(error,result,$) {
        $("#content a:link").each(function(a) {
            c.queue(a.href);
        })
    }
});

// Queue a list of URLs, with default callback
c.queue(["http://jamendo.com/","http://tedxparis.com", ...]);

// Queue URLs with custom callbacks
c.queue([{
    "uri":"http://parisjs.org/register",
    "method":"POST",
    "callback":function(error,result,$) {
        $("div:contains(Thank you)").after(" very much");
    }
}]);

// Queue some HTML code directly without grabbing (mostly for tests)
c.queue([{
    "html":"<p>This is a <strong>test</strong></p>"
}]);

ChangeLog

0.1.0

  • Updated dependencies, notably node 0.4.x
  • Fixes jQuery being redownloaded at each page + include it in the tree
  • Cache support
  • Retries
  • Updated priority support with new generic-pool>=1.0.4

node-crawler's People

Contributors

jellyfrog avatar jhurliman avatar sylvinus avatar talltyler avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

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.