From 9b089d26ee05e63cd71c6d35b0da97f4e04cedca Mon Sep 17 00:00:00 2001 From: MajexH Date: Sat, 17 Aug 2024 22:29:47 +0800 Subject: [PATCH] fix(route/sydwgkzp): sync with the new website structure to fix 503 (#16465) * fix: sync with the new website structure * lint: fix lint error * Update lib/routes/gov/chongqing/sydwgkzp.ts fix: use one class selector --------- --- lib/routes/gov/chongqing/sydwgkzp.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/routes/gov/chongqing/sydwgkzp.ts b/lib/routes/gov/chongqing/sydwgkzp.ts index 7133a02a3a50d3..195b17aca4a55c 100644 --- a/lib/routes/gov/chongqing/sydwgkzp.ts +++ b/lib/routes/gov/chongqing/sydwgkzp.ts @@ -30,12 +30,12 @@ async function handler(ctx: Context): Promise { // 替换 url const sydwgkzpUrl = `https://rlsbj.cq.gov.cn/zwxx_182/sydw/sydwgkzp${year}/`; - const { data: response }: { data: any } = await got(sydwgkzpUrl); + const { data: response } = await got(sydwgkzpUrl); const $ = load(response); // 获取所有的标题 - const list = $('div[class="p-rt rt"] .tab-item > li') + const list = $('ul[class="rsj-list1"] > li') .toArray() .map((item) => { item = $(item); @@ -54,10 +54,10 @@ async function handler(ctx: Context): Promise { const items = await Promise.all( list.map((item) => cache.tryGet(item.link, async () => { - const { data: response }: { data: any } = await got(item.link); + const { data: response } = await got(item.link); const $ = load(response); // 主题正文 - item.description = $('div[class="trs_editor_view TRS_UEDITOR trs_paper_default trs_web"]').first().html(); + item.description = $('.trs_editor_view').first().html(); return item; }) )