あるテストサーバーから OneTimeToken を取得しようとしたら、レスポンスが HTML しかなかったので、AWS Lambda の Node.js で axios と cheerio で、HTML解析(スクレイピング)して JSON をレスポンスさせるようにした話。 Node.js ソースコード const axios = require('axios'); const cheerio = require('cheerio'); const url = '{TARGET_PAGE}'; exports.lambda_handler = (event, context, callback) => { axios(url) .then(({ data }) => { const content = getContent(data); callback(null, { statusCod