添加新新漫画
This commit is contained in:
53
bin/reptile/177mh_net/section.js
Normal file
53
bin/reptile/177mh_net/section.js
Normal file
@@ -0,0 +1,53 @@
|
||||
let axios = require('axios')
|
||||
const cheerio = require('cheerio');
|
||||
|
||||
let getsection = async (text)=>{
|
||||
let $ = cheerio.load(text)
|
||||
// console.log(text)
|
||||
let list = [];
|
||||
let l = $(".ar_rlos_bor").eq(0).html()
|
||||
$ = cheerio.load(l,{decodeEntities: false})
|
||||
$("li").each((index,ele)=>{
|
||||
let con = {}
|
||||
let j = cheerio.load($(ele).html(),{decodeEntities: false})
|
||||
con.url = j("a").eq(0).attr("href")
|
||||
con.title = j("a").eq(0).html()
|
||||
// console.log(con)
|
||||
// console.log($(ele).html())
|
||||
list.push(con)
|
||||
|
||||
})
|
||||
// console.log(txt)
|
||||
// console.log($(".comic-chapters ").eq(0).html())
|
||||
// $(".comic-chapters").each((index,ele)=>{
|
||||
// // $(ele)
|
||||
// // console.log($(ele).html())
|
||||
// let obj = {}
|
||||
// let j = cheerio.load($(ele).html(),{decodeEntities: false})
|
||||
// obj.title = j(".pull-left").eq(0).html().replace('<span>','').replace('</span>','')
|
||||
// obj.list = []
|
||||
// j('li').each(function (index,ele){
|
||||
// let con = {}
|
||||
// con.url = j(this).find("a").eq(0).attr('href')
|
||||
// con.title = j(this).find("a").eq(0).html().replace('<span>','').replace('</span>','').replace(/\s+/g,"").replace('\\n','')
|
||||
// obj.list.push(con)
|
||||
// })
|
||||
// // console.log(obj)
|
||||
// list.push(obj)
|
||||
// })
|
||||
// console.log(list)
|
||||
return list
|
||||
}
|
||||
|
||||
let gethtml = async (url)=>{
|
||||
let text;
|
||||
await axios.get(url).then((res)=>{
|
||||
text = res.data
|
||||
})
|
||||
let list = await getsection(text)
|
||||
// console.log(JSON.stringify(list))
|
||||
return list
|
||||
}
|
||||
|
||||
gethtml('https://www.177mh.net/colist_111001.html')
|
||||
module.exports = gethtml
|
||||
Reference in New Issue
Block a user