fix(route/zhonglun): 修复中伦律师事务所研究文章页面改版导致数据无法获取 (#17527)

This commit is contained in:
ueiu 2024-11-11 08:13:06 +08:00 committed by GitHub
parent 6895333c05
commit 7b1c166a60
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 6 deletions

View File

@ -20,22 +20,21 @@ export const handler = async (ctx) => {
const $ = load(response);
let items = $('div#dataList h3')
let items = $('div#dataList > dl > dd, div#dataList > ul > li')
.slice(0, limit)
.toArray()
.map((item) => {
item = $(item);
const title = item.text();
const description = art(path.join(__dirname, 'templates/description.art'), {
intro: item.next().text(),
intro: item.find('p').text(),
});
return {
title,
title: item.find('h3 > a').text(),
description,
pubDate: parseDate(item.find('span').first().text()),
link: item.find('a').prop('href'),
pubDate: parseDate(item.find('span').text()),
link: item.find('h3 > a').prop('href'),
language,
};
});