From aeb04e2dda6f483b79f2569fb8f23d629458be47 Mon Sep 17 00:00:00 2001 From: Harvey Qiu Date: Mon, 21 Sep 2020 19:50:26 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E7=8E=AF=E7=90=83?= =?UTF-8?q?=E5=BE=8B=E5=B8=88=E4=BA=8B=E5=8A=A1=E6=89=80=E6=96=87=E7=AB=A0?= =?UTF-8?q?=20(#5694)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Henry Wang --- lib/routes/law/hq.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/routes/law/hq.js b/lib/routes/law/hq.js index 008075b3a..9849c299e 100644 --- a/lib/routes/law/hq.js +++ b/lib/routes/law/hq.js @@ -2,16 +2,16 @@ const got = require('@/utils/got'); const cheerio = require('cheerio'); module.exports = async (ctx) => { - const url = 'http://www.glo.com.cn/news/publications_list13.html'; + const url = 'http://www.glo.com.cn/insights/prespectives/'; const res = await got.get(url); const $ = cheerio.load(res.data); - const list = $('ul.ul-list li').get(); + const list = $('.news_listul li').get(); const out = await Promise.all( list.map(async (item) => { const $ = cheerio.load(item); - const title = $('a').attr('title'); - const itemUrl = $('a').attr('href'); + const title = $('a .newstit').text(); + const itemUrl = 'http://www.glo.com.cn/' + $('a').attr('href'); const cache = await ctx.cache.get(itemUrl); if (cache) { @@ -24,7 +24,7 @@ module.exports = async (ctx) => { const single = { title, link: itemUrl, - description: $d('article').html(), + description: $d('.editor_con').html(), }; ctx.cache.set(itemUrl, JSON.stringify(single));