fix: 龙腾网无内容 (#2054)

This commit is contained in:
kimi360
2019-05-07 01:10:05 +08:00
committed by DIYgod
parent a8066bdf35
commit 9631dcfae5
2 changed files with 2 additions and 3 deletions

View File

@@ -1,6 +1,5 @@
const axios = require('../../utils/axios'); // get web content
const cheerio = require('cheerio'); // html parser
const iconv = require('iconv-lite');
const domain = 'http://www.ltaaa.com';
@@ -15,7 +14,7 @@ module.exports = async function get_article(url) {
responseType: 'arraybuffer',
});
const data = response.data;
const $ = cheerio.load(iconv.decode(data, 'CP936'));
const $ = cheerio.load(data);
const title = $('div.post-title > strong').text();
const author = $('div.post-param > a').text();