0.0.8 • Published 10 years ago

jsmaestro-skrap-plus v0.0.8

Weekly downloads
-
License
MIT
Repository
-
Last release
10 years ago

Web site crawling package with ES2015

Usage

const Crawler = require('jsmaestro-skrap-plus').Crawler;

const pageInfo = {
  url: `http://m.daum.net/`,
  collections: [{
    name: 'ranking',
    query: "$('#channel_news1_realtime .list_realtime')",
    fields: {
      1: "find('li .txt_issue').eq(0).text()",
      2: "find('li .txt_issue').eq(1).text()",
      3: "find('li .txt_issue').eq(2).text()"
    },
  }],
};

const promise = Crawler(pageInfo, {});

promise.then(function(res) {
  // do something
  const page = value.ranking[0]; //  { '1': 'whatever1', '2': 'whatever2', '3': 'whatever3' }
}).catch(function(error) {
  // do error handling
});

For Testing with Mocha and Chai

npm test
0.0.8

10 years ago

0.0.7

10 years ago

0.0.6

10 years ago

0.0.5

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago