diff --git a/lib/routes/arknights/news.js b/lib/routes/arknights/news.js index 78db0b84fc3cf5..ea3c299baae33a 100644 --- a/lib/routes/arknights/news.js +++ b/lib/routes/arknights/news.js @@ -10,23 +10,24 @@ module.exports = async (ctx) => { let newslist = response.data; const $ = cheerio.load(newslist); - newslist = $('#news > div > div.news-block > ul:first-child > li'); + newslist = $('.articleItem > .articleItemLink'); newslist = await Promise.all( newslist + .slice(0, 9) // limit article count to a single page .map(async (index, item) => { const sth = $(item); - const link = `https://ak.hypergryph.com${sth.find('a').attr('href').slice(1)}`; + const link = `https://ak.hypergryph.com${sth.attr('href')}`; const description = await ctx.cache.tryGet(link, async () => { const result = await got.get(link); const $ = cheerio.load(result.data); - return $('.article-inner').html(); + return $('.article-content').html(); }); return { - title: sth.find('.news-title').first().text(), + title: `[${sth.find('.articleItemCate').first().text()}] ${sth.find('.articleItemTitle').first().text()}`, description, link, - pubDate: new Date(sth.find('.news-date-text').first().text()), + pubDate: new Date(sth.find('.articleItemDate').first().text()), }; }) .get()