Nanobot: Polygonal Mascot
Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

node-scrapper

0.0.1 • Public • Published

node-scrapper

Non-blocking node.js scrapper.
Inspired by scrappy.

Usage

import {crawl} from 'node-scrapper';
 
function* parse(browser, spider) {
    let source = yield browser.getText('#my-element');
    let pictureUrl = yield browser.getAttribute('#my-second-element', 'href');
    spider.get(pictureUrl, parsePicture);
}
 
function* parsePicture(browser, spider) {
    let imageUrl = yield browser.getAttribute('img.logo', 'src');
    saveToDB(imageUrl);
}
 
crawl(spider => {
    spider.get('http://example.com', parse);
});
 

Keywords

none

install

npm i node-scrapper

Downloadsweekly downloads

3

version

0.0.1

license

ISC

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability