mirror of
https://github.com/DIYgod/RSSHub.git
synced 2026-09-24 23:12:34 +08:00
fix: 修复多知网内容获取 (#3282)
This commit is contained in:
@@ -4,16 +4,14 @@ const cheerio = require('cheerio');
|
||||
module.exports = async (ctx) => {
|
||||
const response = await got('http://www.duozhi.com/');
|
||||
const $ = cheerio.load(response.data);
|
||||
const postList = $('.post-list .post').get();
|
||||
const postList = $('.list-post .post-item').get();
|
||||
const result = await Promise.all(
|
||||
postList.map(async (item) => {
|
||||
const title = $(item)
|
||||
.find('.post-title')
|
||||
.find('a')
|
||||
.text();
|
||||
const link = $(item)
|
||||
.find('.post-title')
|
||||
.find('a')
|
||||
.attr('href');
|
||||
const guid = link;
|
||||
|
||||
@@ -41,8 +39,9 @@ module.exports = async (ctx) => {
|
||||
.replace(/alt="\\"/g, '');
|
||||
single.pubDate = new Date(
|
||||
$(temp.data)
|
||||
.find('.meta-date')
|
||||
.find('.subject-meta')
|
||||
.text()
|
||||
.trim()
|
||||
.substr(0, 18)
|
||||
).toUTCString();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user