我正在尝试从我的 node.js 项目https://stockx.com/api/products/nike-daybreak-undercover-black?includes=market上的此链接解析信息
当我通过邮递员访问链接并在网络浏览器上访问 url 时,我能够获取信息。但是,当我尝试通过我的 node.js 项目访问请求时,它说访问被拒绝。知道为什么吗?谢谢。这是我的代码:
const express = require('express');
const request = require('request');
const cheerio = require('cheerio');
const axios = require('axios')
const app = express();
app.get('/', function(req, res){
let shoe =req.query.shoe;
let url = 'https://stockx.com/api/products/nike-daybreak-undercover-black?includes=market'
request(url, function(error, response, html) {
if (!error) {
var $ = cheerio.load(html);
console.log(html)
res.send();
}
});
});
app.listen('8080');
console.log('API is running on http://localhost:8080');
module.exports = app;
30秒到达战场
交互式爱情
相关分类