fix economist article displaying (#10884)
This commit is contained in:
parent
7fdffa9133
commit
3119ebda4d
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue