From 9ff96364b643fcbbdeb5c0e2b8740c85480e2c18 Mon Sep 17 00:00:00 2001 From: Chenyang Shi Date: Fri, 15 Mar 2019 14:26:32 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E5=90=8E=E7=BB=AD=20lives=20(#1756)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit close #1753 网页结构变化 --- lib/routes/houxu/lives.js | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/lib/routes/houxu/lives.js b/lib/routes/houxu/lives.js index 247c96af79..f8ca883949 100644 --- a/lib/routes/houxu/lives.js +++ b/lib/routes/houxu/lives.js @@ -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();