fix: 浙工大设计与建筑学院description部分获取不全 (#5669)

This commit is contained in:
yikZero
2020-09-20 21:06:34 +01:00
committed by GitHub
parent 83e49b928e
commit b3b5a8ef72
2 changed files with 6 additions and 6 deletions
+4 -4
View File
@@ -1766,11 +1766,11 @@ type 列表:
### 设计与建筑学院
<Route author="yikZero" example="/zjut/design/5" path="/zjut/design/:type" :paramsDesc="['板块id']">
<Route author="yikZero" example="/zjut/design/16" path="/zjut/design/:type" :paramsDesc="['板块id']">
| 学术科研 | 学院新闻 | 公告通知 | 学术交流 |
| -------- | -------- | -------- | -------- |
| 5 | 16 | 18 | 20 |
| 学院新闻 | 公告通知 | 学术交流 |
| -------- | -------- | -------- |
| 16 | 18 | 20 |
</Route>
+2 -2
View File
@@ -43,8 +43,8 @@ module.exports = async (ctx) => {
}
const itemReponse = await got({ method: 'get', url: link, responseType: 'buffer' });
const itemElement = cheerio.load(iconv.decode(itemReponse.data, 'gbk'));
item.description = itemElement('#jiacu').html();
const itemElement = cheerio.load(iconv.decode(itemReponse.data, 'utf-8'));
item.description = itemElement('div[style="line-height:27px;"]').html();
ctx.cache.set(link, JSON.stringify(item));
return Promise.resolve(item);