mirror of
https://github.com/DIYgod/RSSHub.git
synced 2026-10-24 12:15:32 +08:00
fix: ithome failure (#5727)
This commit is contained in:
@@ -43,7 +43,7 @@ module.exports = async (ctx) => {
|
||||
});
|
||||
|
||||
const $ = cheerio.load(response.data);
|
||||
const list = $('div.wrap_left_top div.mf div.new-list-1 li[class!="top"] span.title a')
|
||||
const list = $('#list > div.fl > ul > li > div > h2 > a')
|
||||
.slice(0, 10)
|
||||
.map((_, item) => {
|
||||
item = $(item);
|
||||
@@ -60,16 +60,15 @@ module.exports = async (ctx) => {
|
||||
await ctx.cache.tryGet(item.link, async () => {
|
||||
const res = await got({ method: 'get', url: item.link });
|
||||
const content = cheerio.load(res.data);
|
||||
const post = content('div#con div.content');
|
||||
const paragraph = post.find('div#paragraph');
|
||||
paragraph.find('img[data-original]').each((_, ele) => {
|
||||
const post = content('#paragraph');
|
||||
post.find('img[data-original]').each((_, ele) => {
|
||||
ele = $(ele);
|
||||
ele.attr('src', ele.attr('data-original'));
|
||||
ele.removeAttr('class');
|
||||
ele.removeAttr('data-original');
|
||||
});
|
||||
item.description = paragraph.html();
|
||||
item.pubDate = new Date(post.find('span#pubtime_baidu').text() + ' GMT+8').toUTCString();
|
||||
item.description = post.html();
|
||||
item.pubDate = new Date(content('#pubtime_baidu').text() + ' GMT+8').toUTCString();
|
||||
return item;
|
||||
})
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user