Get unlimited public & private packages + package-based permissions with npm Pro.Get started »

aimer

1.0.1 • Public • Published

aimer NPM version NPM downloads Circle CI

Remote web content crawler done right.

Motivation

Sometimes I want to grab some nice images from a url like http://bbs.005.tv/thread-492392-1-1.html, so I made this little program to combine node-fetch and cheerio to make my attempt fulfilled. And it uses nightmare to handle SPAs.

Install

$ npm install --save aimer

Usage

const aimer = require('aimer')
 
aimer('http://some-url.com/a/b/c')
    .then($ => {
        $('img.nice-images').each(function () {
            const url = $(this).attr('src')
            console.log(url)
        })
    })
 
// or even single page website!
const nightmare = require('aimer/nightmare')
nightmare('http://some-url.com/#!/list')
  .then($ => {
    // your code goes here
  })

API

aimer(url, opts)

opts

cheerio

cheerio options. Except decodeEntities is false by default here.

nightmare(url, opts)

Use nightmare to retrieve html from url, this is good for handling SPA website.

opts

cheerio

cheerio options. Except decodeEntities is false by default here.

nightmare

nightmare options.

License

MIT © EGOIST

Keywords

none

Install

npm i [email protected]

Version

1.0.1

License

MIT

Last publish

Collaborators

  • avatar
  • avatar