@@ -4,7 +4,12 @@ const cheerio = require('cheerio');
|
||||
module.exports = async (ctx) => {
|
||||
const base = 'https://art.hnust.edu.cn/ggtz/';
|
||||
const link = base + 'index.htm';
|
||||
const response = await got.get(link);
|
||||
const response = await got.get({
|
||||
url: link,
|
||||
https: {
|
||||
rejectUnauthorized: false,
|
||||
},
|
||||
});
|
||||
const $ = cheerio.load(response.data);
|
||||
const list = $('.newsList03 li');
|
||||
|
||||
|
||||
@@ -2,12 +2,16 @@ const got = require('@/utils/got');
|
||||
const cheerio = require('cheerio');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const base = 'http://jwc.hnust.edu.cn/gzzd2_20170827120536008171/jwk3_20170827120536008171/';
|
||||
const base = 'https://jwc.hnust.edu.cn/gzzd2_20170827120536008171/jwk3_20170827120536008171/';
|
||||
const link = base + 'index.htm';
|
||||
const response = await got.get(link);
|
||||
const response = await got.get({
|
||||
url: link,
|
||||
https: {
|
||||
rejectUnauthorized: false,
|
||||
},
|
||||
});
|
||||
const $ = cheerio.load(response.data);
|
||||
const list = $('.articleList ul li');
|
||||
|
||||
ctx.state.data = {
|
||||
title: '湖南科技大学教务处通知',
|
||||
link: link,
|
||||
|
||||
Reference in New Issue
Block a user