Skip to content

Commit

Permalink
fix(route/zhonglun): 修复中伦律师事务所研究文章页面改版导致数据无法获取 (DIYgod#17527)
Browse files Browse the repository at this point in the history
  • Loading branch information
ueiu authored Nov 11, 2024
1 parent 6895333 commit 7b1c166
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions lib/routes/zhonglun/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
});
Expand Down

0 comments on commit 7b1c166

Please sign in to comment.