Skip to content

Latest commit

 

History

History
43 lines (31 loc) · 1013 Bytes

README.md

File metadata and controls

43 lines (31 loc) · 1013 Bytes

supercheer

CircleCIView on NPM View on NPM

supercheer is a wrapper, wrapping superagent and cheerio, make it easy to do crawling webpage.

Setup

Install:

npm install supercheer --save

Usage

supercheer.query( url, selectors, transform )

const supercheer = require('supercheer');

const r = await supercheer.query(
  'https://www.google.com/',
  {
    title: 'title',
    firstChar: 'title',
  },
  {
    firstChar: (v) => v.slice(0, 1),
  }
);

// {
//   title: 'Google',
//   firstChar: 'G',
// }
console.log(r);

License

MIT. See LICENSE for details.