fix economist article displaying (#10884)

This commit is contained in:
Felix Hsu 2022-09-24 17:30:39 +08:00 committed by GitHub
parent 7fdffa9133
commit 3119ebda4d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -7,7 +7,7 @@ const getArticleDetail = async (link, ctx) =>
const response = await got(link);
const $ = cheerio.load(response.data);
$('div.article-audio-player__center-tooltip').remove();
const nextData = JSON.parse($('head script[type="application/ld+json"]').text());
const nextData = JSON.parse($('head script[type="application/ld+json"]').first().text());
const article = ($('figure[class^=css-]').first().parent().parent().html() || '') + $('p.article__body-text').parent().html();
const categories = nextData.keywords?.map((k) => k);