Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

cat-claws

tennisonchan11MIT0.0.1

Cat claws for scraping

cats, scrape, scraper, cat, scraping, claws, nodejs, node

readme

Cat Claws :paw_prints:

A :cat:'s :paw_prints: to scrape any furnitures

cat-claws-logo

Build Status

Installation

npm install --save cat-claws

Examples

const claws = require('cat-claws');

claws('https://www.nytimes.com/', {
  stories: ['.story.theme-summary',
    {
      storyHeading: '.story-heading a',
      url: function ($el) {
        return $el.find('[href]').attr('href');
      },
      summary: '.summary'
    }
  ]
}).then(json => {
  console.log(json);
  // {
  //   stories: [{
  //     storyHeading: 'The Breaking Cat News!',
  //     url: 'https://www.huffingtonpost.com/topic/funny-cats',
  //     summary: 'I smelled something funny when I was getting ready for work one day. I followed the smell to the kitchen, where I found that my cat had turned...'
  //   }, {
  //     ...
  //   }]
  // }
});