0.0.6 • Published 4 years ago

spider-adapters v0.0.6

Weekly downloads
10
License
MIT
Repository
github
Last release
4 years ago

Spider Adapters

🕷️ Adapter for spiders, using Cheerio to parse HTML response.
[中文版] | NPM


How to install?

npm i spider-adapters

How to use?

//My testing code in test/index.js
const adapters = require('spider-adapters');

let links = [
    'https://github.com/trending/',
];

links.map(async link => {
    let data = await adapters.deal(link);
    console.log(data);
});

Or simply use it as:

let source = 'https://github.com/trending/';
let data = require('spider-adapters').deal(link)

List for existing adapters:


How to create your own one?

Add a file (any name is acceptable), in /adapter/ folder. Define its name and pattern, then define a handler function. Pass these to Adapter class, then you got it.

0.0.6

4 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago