用node爬点羞羞图吧~2019-01-24

npm i request request-promise cheerio
npm index.js
const rp = require("request-promise")
const fs = require("fs")
const cheerio = require("cheerio")

class Download {
  constructor(url){
    this.curPage = 1
    this.main(url)
  }
  async main(url){
    const pageTotal = await this.getPageTotal(url)
    console.log(`成功获取到 ${pageTotal} 个页面,开始分页获取~`)
    for (let j=1; j<=pageTotal; j++) {
      const pageList = await this.getPageData(url, j)
      for (let i=0; i

你可能感兴趣的:(用node爬点羞羞图吧~2019-01-24)