Skip to content

Commit

Permalink
fix(route/sydwgkzp): sync with the new website structure to fix 503 (#…
Browse files Browse the repository at this point in the history
…16465)

* fix: sync with the new website structure

* lint: fix lint error

* Update lib/routes/gov/chongqing/sydwgkzp.ts

fix: use one class selector

---------
  • Loading branch information
MajexH authored Aug 17, 2024
1 parent e77bdb8 commit 9b089d2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/routes/gov/chongqing/sydwgkzp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ async function handler(ctx: Context): Promise<Data> {
// 替换 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);
Expand All @@ -54,10 +54,10 @@ async function handler(ctx: Context): Promise<Data> {
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;
})
)
Expand Down

0 comments on commit 9b089d2

Please sign in to comment.