[英]Getting 403 Forbidden error while trying to add attachment to sharepoint list
[英]Getting error 403 with axios while trying to fetch 'title' with jquery
我正在尝试使用 axios 和cheerio 从网站上刮掉标题
这是我的 function:
async function getWebsiteInfo(uniqueId, req, res) {
const axios = require('axios');
const cheerio = require('cheerio');
axios.get(req.body.url)
.then(response => {
const html = response.data;
const $ = cheerio.load(html);
const scrapedata = $('title').first().text();
console.log(scrapedata);
var object = {
"uuid": uniqueId,
"url": req.body.url,
"info": scrapedata
}
addToDatabase(object, res);
}).catch(error => {
console.log(error);
});
}
我能做些什么来避免出现错误 403?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.