我正在从网页上抓取信息,除此以外,我已经能够获取所有信息:一个带有令牌的脚本。目前,我已经向网页提出了获取请求,并且看到了它返回脚本的位置。我的代码是:
const axios = require('axios');
const cheerio = require('cheerio');
const buyItem = async (cookie, assetId) => {
// Get x-csrf-token, product id, and price
await axios.default.request({
url: `https://www.roblox.com/catalog/${assetId}`,
method: "GET",
headers: {Cookie: `.ROBLOSECURITY=${cookie};`}
}).then(response => {
const $ = cheerio.load(response.data);
console.log(response)
})
};