style: auto format
This commit is contained in:
+3
-3
@@ -150,9 +150,9 @@ pageClass: routes
|
||||
|
||||
<Route author="zytomorrow" example="/gov/sichuan/deyang/govpublicinfo/绵竹市" path="/gov/sichuan/deyang/govpublicinfo/:countyName/:infoType?" :paramsDesc="['区县名(**其他区县整改中,暂时只支持`绵竹市`**)。德阳市、绵竹市、广汉市、什邡市、中江县、罗江区、旌阳区、高新区', '信息类型。默认值:fdzdnr-“法定主动内容”']">
|
||||
|
||||
| 法定主动内容 | 公示公告 |
|
||||
|:--------:|:----:|
|
||||
| fdzdnr | gsgg |
|
||||
| 法定主动内容 | 公示公告 |
|
||||
| :----------: | :------: |
|
||||
| fdzdnr | gsgg |
|
||||
|
||||
</Route>
|
||||
|
||||
|
||||
@@ -26,10 +26,12 @@ const getInfoUrlList = async (rootUrl, infoBasicUrl) => {
|
||||
const response = await got(infoBasicUrl);
|
||||
const $ = cheerio.load(response.data);
|
||||
// 非当前日期文章计数,部分旧文章可能会置顶,目前为发现置顶数超过10
|
||||
const infoList = $('body > div.container > div.ewb-white > div.ewb-job > ul > li').toArray().map((item) => ({
|
||||
title: $('a', item).attr('title'),
|
||||
url: `${rootUrl}${$('a', item).attr('href')}`,
|
||||
}));
|
||||
const infoList = $('body > div.container > div.ewb-white > div.ewb-job > ul > li')
|
||||
.toArray()
|
||||
.map((item) => ({
|
||||
title: $('a', item).attr('title'),
|
||||
url: `${rootUrl}${$('a', item).attr('href')}`,
|
||||
}));
|
||||
return infoList;
|
||||
};
|
||||
|
||||
@@ -40,10 +42,12 @@ const getInfoContent = (ctx, rootUrl, item) =>
|
||||
// 部分网页会跳转其他类型网站,则不解析,直接附超链接
|
||||
try {
|
||||
const $ = cheerio.load(response.data);
|
||||
const fileList = $('#symbol > div:nth-child(4) > div > span > a').toArray().map((item) => ({
|
||||
name: $(item).text(),
|
||||
url: `${rootUrl}/${$(item).attr('href')}`,
|
||||
}));
|
||||
const fileList = $('#symbol > div:nth-child(4) > div > span > a')
|
||||
.toArray()
|
||||
.map((item) => ({
|
||||
name: $(item).text(),
|
||||
url: `${rootUrl}/${$(item).attr('href')}`,
|
||||
}));
|
||||
const rawDate = $('#symbol > div:nth-child(1) > div:nth-child(3)').text().split(':')[1].trim();
|
||||
return {
|
||||
title: $('#main').text().trim(),
|
||||
|
||||
Reference in New Issue
Block a user