fix 后续 lives (#1756)

close #1753 
网页结构变化
This commit is contained in:
Chenyang Shi 2019-03-15 14:26:32 +08:00 committed by DIYgod
parent ec5d67d268
commit 9ff96364b6
1 changed files with 3 additions and 10 deletions

View File

@ -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();