const got = require('@/utils/got'); const cheerio = require('cheerio'); module.exports = async (ctx) => { const category = ctx.params.category ?? '年度日更'; const rootUrl = 'https://www.igetget.com'; const response = await got({ method: 'get', url: rootUrl, }); const listUrl = `${rootUrl}${response.data.match(new RegExp('年度日更<\\/a>'))[1]}`; const listResponse = await got({ method: 'get', url: listUrl, }); const currentUrl = `${rootUrl}${listResponse.data.match(new RegExp('' + category + '<\\/span>