diff --git a/lib/routes/gov/news/index.js b/lib/routes/gov/news/index.js index 4ed928936..5e85eb3c5 100644 --- a/lib/routes/gov/news/index.js +++ b/lib/routes/gov/news/index.js @@ -44,13 +44,11 @@ module.exports = async (ctx) => { const description = await ctx.cache.tryGet(contenlUrl, async () => { const fullTextGet = await got.get(contenlUrl); const fullTextData = cheerio.load(fullTextGet.data); - if (uid === 'yaowen') { + const $1 = fullTextData.html(); + if ($1.search(/UCAP-CONTENT/g) === -1) { fullText = fullTextData('body').html(); } else { - fullText = fullTextData('.pages_content').html(); - if (fullText === null) { - fullText = fullTextData('body').html(); // 解决国务院信息部分条目无法获取全文 - } + fullText = fullTextData('#UCAP-CONTENT').html(); } const regImg = /(img src=")(.*)(".*)/g; const regUrl = /(http.*\/)(content.*)/; @@ -60,7 +58,7 @@ module.exports = async (ctx) => { return { title: item.find('a').text(), description: description, - link: item.find('a').attr('href'), + link: contenlUrl, }; }) .get() diff --git a/lib/routes/gov/statecouncil/briefing.js b/lib/routes/gov/statecouncil/briefing.js index ab5d2f9aa..b52f3ddef 100644 --- a/lib/routes/gov/statecouncil/briefing.js +++ b/lib/routes/gov/statecouncil/briefing.js @@ -2,10 +2,10 @@ const got = require('@/utils/got'); const cheerio = require('cheerio'); module.exports = async (ctx) => { - const link = `http://www.scio.gov.cn/32344/index.htm`; + const link = `http://www.gov.cn/xinwen/xwfb_wszb.htm`; const listData = await got.get(link); const $ = cheerio.load(listData.data); - const list = $('.list .mb10 .mt10 li'); + const list = $('.list01 li'); ctx.state.data = { title: '国务院 - 吹风会', @@ -20,12 +20,12 @@ module.exports = async (ctx) => { const description = await ctx.cache.tryGet(contenlUrl, async () => { const fullText = await got.get(contenlUrl); const fullTextData = cheerio.load(fullText.data); - return fullTextData('.textlive'); + return fullTextData('.online_list').html(); }); return { title: item.find('a').text(), description: description, - link: item.find('a').attr('href'), + link: contenlUrl, }; }) .get()