Merge branch 'master' into feature/got

This commit is contained in:
DIYgod
2019-06-03 17:06:48 +08:00
705 changed files with 13279 additions and 7218 deletions

View File

@@ -1,6 +1,5 @@
const axios = require('../../utils/axios'); // get web content
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: 'buffer',
});
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();