压缩下载完成
This commit is contained in:
43
bin/reptile/gufengmh8/find.js
Normal file
43
bin/reptile/gufengmh8/find.js
Normal file
@@ -0,0 +1,43 @@
|
||||
let axios = require('axios')
|
||||
const cheerio = require('cheerio');
|
||||
const qs = require('querystring');
|
||||
let getcontlist = async (text) => {
|
||||
let $ = cheerio.load(text)
|
||||
let list = []
|
||||
$ = cheerio.load($("#contList").eq(0).html())
|
||||
// console.log($("li").eq(0).html())
|
||||
$("li").each((index,ele)=>{
|
||||
let j = cheerio.load($(ele).html(),{decodeEntities: false})
|
||||
// console.log(unescape(j('.tt').eq(0).html()))
|
||||
let obj = {};
|
||||
obj.update = j('.tt').eq(0).html()
|
||||
obj.name = j(".ell a").eq(0).html()
|
||||
obj.date = j(".updateon").eq(0).html().replace(/\s+/g,"").replace('<em>1.0</em>','')
|
||||
obj.url = j(".cover").eq(0).attr('href')
|
||||
// console.log(obj)
|
||||
list.push(obj)
|
||||
})
|
||||
return list
|
||||
}
|
||||
|
||||
let gethtml = async (name, page) => {
|
||||
name = qs.escape(name)
|
||||
let url = `https://www.gufengmh8.com/search/?keywords=${name}&page=${page}`
|
||||
// console.log(url)
|
||||
let text = ""
|
||||
await axios.get(url).then((a) => {
|
||||
// console.log(a.text)
|
||||
// res(a.text)
|
||||
text = a.data
|
||||
})
|
||||
return await getcontlist(text)
|
||||
}
|
||||
|
||||
let getlist = async (name) => {
|
||||
let html;
|
||||
html = await gethtml(name, 1)
|
||||
console.log(html)
|
||||
return html;
|
||||
}
|
||||
getlist("偷星九月天")
|
||||
// module.exports = getlist
|
||||
Reference in New Issue
Block a user