parent
ec5d67d268
commit
9ff96364b6
|
|
@ -7,24 +7,17 @@ module.exports = async (ctx) => {
|
|||
const res = await axios.get(baseUrl);
|
||||
const $ = cheerio.load(res.data);
|
||||
|
||||
const list = $('div.container > div');
|
||||
const list = $('div.live-realtime');
|
||||
const out = list
|
||||
.map((_, el) => {
|
||||
const each = $(el);
|
||||
|
||||
const p = each.find('p');
|
||||
return {
|
||||
title: each
|
||||
.find('h3')
|
||||
.find('h4 > a')
|
||||
.text()
|
||||
.trim(),
|
||||
description: p.html() + p.next().html(),
|
||||
link:
|
||||
'https://houxu.app' +
|
||||
each
|
||||
.find('h3 > a')
|
||||
.first()
|
||||
.attr('href'),
|
||||
link: 'https://houxu.app' + each.find('h4 > a').attr('href'),
|
||||
};
|
||||
})
|
||||
.get();
|
||||
|
|
|
|||
Loading…
Reference in New Issue