mirror of
https://github.com/DIYgod/RSSHub.git
synced 2026-08-31 01:01:11 +08:00
fix(route): lhratings.com research pdf links (#22866)
This commit is contained in:
@@ -24,11 +24,10 @@ export const handler = async (ctx: Context): Promise<Data> => {
|
||||
.toArray()
|
||||
.map((el): Element => {
|
||||
const $el: Cheerio<Element> = $(el);
|
||||
const $aEl: Cheerio<Element> = $el.find('a').first();
|
||||
|
||||
const title: string = $el.find('h2').text();
|
||||
const pubDateStr: string | undefined = $el.find('p').text().split(':', 2)[1]?.trim();
|
||||
const linkUrl: string | undefined = $aEl.attr('href') ? new URL($aEl.attr('href') ?? '', baseUrl).href : undefined;
|
||||
const linkUrl: string | undefined = $el.attr('href') ? new URL($el.attr('href') ?? '', baseUrl).href : undefined;
|
||||
const categoryEls: Array<Cheerio<Element>> = [$el.find('h3').contents()].filter(Boolean);
|
||||
const categories: string[] = [...new Set(categoryEls.map((el) => $(el).text()).filter(Boolean))];
|
||||
const image: string | undefined = $el.find('div.xylist_img img').attr('src') ? new URL($el.find('div.xylist_img img').attr('src') ?? '', baseUrl).href : undefined;
|
||||
|
||||
Reference in New Issue
Block a user