爬取结果
完整代码
主要代码:
在node环境下直接运行此代码
const request = require('request')
const fs = require('fs')
const {
fsRead,
fsWrite,
fsDir
} = require('./lcfs')
let httpUrl = "https://www.1905.com/vod/list/n_1/o3p1.html"
//请求网页函数
function req(url) {
return new Promise(function (resolve, reject) {
request.get(url, function (err, response, body) {
if (err) {
reject(err)
} else {
resolve(response, body)
}
})
})
}
//爬取多页数据
// function getMorePageMovies(page) {
// for(let i = 1; i <= page;i ++) {
// let MoreHttpUrl = "https://www.1905.com/vod/list/n_1/o3p" + i + ".html"
// //i表示第几页
// getClassUrl(MoreHttpUrl,i);
// }
// }
// getMorePageMovies(80);
//获取