美女图片小爬虫,嘿嘿
/** * Created by Administrator on 2016/9/22 0022. */ //依赖的模块 var http=require('http'); var fs=require('fs'); var cheerio=require('cheerio'); var request=require('request'); var iconv = require('iconv-lite'); //设置参数 new GetSexyPics({ initUrl: 'http://www.mm131.com/xinggan/2655_20.html',//初始化网页请求地址 maxNum: 100,//设置最大爬取数量(maxNum-index的值即爬取图片的数量) intervalTime: 800,//设置间隔时间 index: 0//从0开始标记爬取的数量 }); function GetSexyPics(params) { _this=this; _this.setParams=params; this.createFolder = function (name) { fs.exists('./' + name, function (exists) { if (!exists) { fs.mkdir('./' + name); } }); }; this