fix: /nikkei/news (#6343)
This commit is contained in:
parent
8db7c0042a
commit
b0e7d38376
|
|
@ -113,7 +113,16 @@ module.exports = async (ctx) => {
|
|||
const description = await ctx.cache.tryGet(link, async () => {
|
||||
const response = await got.get(link);
|
||||
const $ = cheerio.load(response.data);
|
||||
return $('div.cmn-article_text.a-cf.JSID_key_fonttxt.m-streamer_medium').html();
|
||||
if ($('section.container_cz8tiun').length > 0) {
|
||||
$('section.container_cz8tiun').find('figure').each((index, item) => {
|
||||
const imgSrc = $(item).attr('data-src-for-image-viewer');
|
||||
const $imgElement = $('<img src="' + imgSrc + '"/>');
|
||||
$(item).prepend($imgElement);
|
||||
});
|
||||
return $('section.container_cz8tiun').html();
|
||||
} else {
|
||||
return $('div.sc-54bcr2-2.jMNzyO').html();
|
||||
}
|
||||
});
|
||||
|
||||
return {
|
||||
|
|
|
|||
Loading…
Reference in New Issue