fix: 修复联合早报抓取 (#3462)

This commit is contained in:
Wade Ying
2019-11-21 17:56:57 +08:00
committed by DIYgod
parent d8b585719a
commit 2cbbac7424
+6 -5
View File
@@ -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,