next-page-kit 爬下一页下一页这种页面的小工具

2016-06-25 12:40:34 +08:00
 magicdawn

本文首发于 CNodejs.org https://cnodejs.org/topic/576e0babd3baaf401780bb5f

------------------- 原文--------------------

RT. 就是下一页, 下一页这种...给抽象了一下... 这里有个抓取 V2EX 的栗子 https://github.com/magicdawn/next-page-kit/blob/v0.0.1/test/simple.js#L16 提供本页要干啥, 是否有下一页, 下一页地址... 最后得到一个结果...就是这样

下面是 README ---------------------------------我是分割线-----------------------------

next-page-kit

Helper for handle next-next page

Install

npm i next-page-kit -S

API

const NextPage = require('next-page-kit');

n = new NextPage

const n = new NextPage({
  init() {

  },
  postInit() {

  },

  action($) {

  },
  hasNext($) {

  },
  getNext($) {

  }
});

yield n.run()

n.run

n.run(url, options)

Changelog

CHANGELOG.md

License

the MIT License http://magicdawn.mit-license.org

2745 次点击
所在节点    Node.js
0 条回复

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/288223

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX