From 2cbbac7424ea5affef6ca0bc161b00246cb11581 Mon Sep 17 00:00:00 2001 From: Wade Ying Date: Thu, 21 Nov 2019 17:56:57 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E8=81=94=E5=90=88?= =?UTF-8?q?=E6=97=A9=E6=8A=A5=E6=8A=93=E5=8F=96=20(#3462)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/routes/zaobao/util.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/routes/zaobao/util.js b/lib/routes/zaobao/util.js index 4b214b9326..420e2a9f68 100644 --- a/lib/routes/zaobao/util.js +++ b/lib/routes/zaobao/util.js @@ -24,7 +24,7 @@ const got_ins = got.extend({ const parseList = async (ctx, sectionUrl) => { const response = await got_ins.get(baseUrl + sectionUrl); const $ = cheerio.load(response.data); - const data = $('.row.list', '.post-list').find('.content'); + const data = $('.article-list').find('.article-type'); const title = $('#breadcrumbs > a') .toArray() @@ -49,17 +49,18 @@ const parseList = async (ctx, sectionUrl) => { const article = await got_ins.get(link); const $1 = cheerio.load(article.data); - const time = $1('.datestamp.date-published.meta-date-published', '.body-content') + const time = $1('.title-byline.date-published', '.content') + .slice(0, 1) .text() .replace('年', '-') .replace('月', '-') .replace('日', '') - .replace('发布/', ''); + .replace('发布 /', ''); - const description = $1('.article-content-container').html(); + const description = $1('.article-content').html(); resultItem = { - title: $1('h1', '.body-content').text(), + title: $1('h1', '.content').text(), description: description, pubDate: new Date(time).toUTCString(), link: link,