From e93472638fd77a131b223d619417fe92b460c0ff Mon Sep 17 00:00:00 2001 From: Andvari <31068367+dzx-dzx@users.noreply.github.com> Date: Fri, 23 Feb 2024 00:37:58 +0800 Subject: [PATCH] fix(route/pts): Modify item parsing method. (#14526) * fix(route/pts): Modify item parsing method. * . --- lib/v2/pts/index.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/v2/pts/index.js b/lib/v2/pts/index.js index 22db09bdf9..38b16a0e32 100644 --- a/lib/v2/pts/index.js +++ b/lib/v2/pts/index.js @@ -38,11 +38,11 @@ module.exports = async (ctx) => { const content = cheerio.load(detailResponse.data); - item.author = content('meta[name="author"]') - .attr('content') - .replace(/文//, '') - .split(//|\/|編譯|報導/)[0]; - item.pubDate = timezone(parseDate(content('meta[property="article:published_time"]').attr('content')), +8); + item.author = content('.reporter-container a') + .toArray() + .map((e) => ({ name: content(e).text() })); + item.pubDate = timezone(parseDate(content('.article-time .mr-2 time').text()), +8); + item.updated = timezone(parseDate(content('.article-time span:nth-child(2) time').text()), +8); item.category = content('.tag-list') .first() .find('.blue-tag')