next-page-kit
Helper for handle next-next page
Install
$ npm i -S next-page-kit
API
const NextPageKit =
n = new NextPageKit(options)
options |
type | remark |
---|---|---|
options.charset |
type: String , allowedutf8 or gbk |
the page charset |
options.getCurrent |
function ($: cheerio) => any |
returns current paeg data |
options.hasNext |
function ($: cheerio) => Boolean |
test has next page |
options.getNext |
function ($: cheerio) => String |
get next page url |
const n = { return } {} {} // Promise<string[]>// all img srcn
n.run(url, options)
url
: the entryoptions
:limit
: page limit
types/index.d.ts
more see ///
Changelog
License
the MIT License http://magicdawn.mit-license.org