From 3119ebda4d7edcd5769e31c1ff80c63c8fd72e7b Mon Sep 17 00:00:00 2001 From: Felix Hsu Date: Sat, 24 Sep 2022 17:30:39 +0800 Subject: [PATCH] fix economist article displaying (#10884) --- lib/v2/economist/full.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/v2/economist/full.js b/lib/v2/economist/full.js index e310bbe054..fb08c4d3f7 100644 --- a/lib/v2/economist/full.js +++ b/lib/v2/economist/full.js @@ -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);