fix(route/caixin): 使用新的新闻列表获取方式 (#12783)
This commit is contained in:
parent
45f4155d4d
commit
c7d93dc4df
|
|
@ -6,13 +6,13 @@ const { art } = require('@/utils/render');
|
|||
const path = require('path');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const li_r = await got('https://www.caixin.com/2021-08-22/101758426.html');
|
||||
const li_r = await got('https://www.caixin.com/search/scroll/0.jsp');
|
||||
|
||||
const $ = cheerio.load(li_r.data);
|
||||
const list = $('div.columnBox a[name="new_artical"]~ul.list li')
|
||||
const list = $('div.news_content dl dd')
|
||||
.toArray()
|
||||
.map((li) => ({
|
||||
link: $(li).find('a').first().attr('href').replace('http://', 'https://'),
|
||||
.map((dd) => ({
|
||||
link: $(dd).find('a').first().attr('href').replace('http://', 'https://'),
|
||||
}))
|
||||
.filter((item) => !item.link.startsWith('https://fm.caixin.com/') && !item.link.startsWith('https://video.caixin.com/') && !item.link.startsWith('https://datanews.caixin.com/')); // content filter
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue