我正在使用网络抓取应用程序。我试图让GET请求来获得在路线的NodeJS我在app.get路线,但我得到写了一些异步代码unhandledPromiseRejection error。我在app.get中声明了回调函数,以便可以异步获取响应。
我使用了async await语法,如下所示,这可能是错误的。任何帮助表示赞赏!
app.get('/', async (req,res) => {
let USERNAME = req.query.search_name;
const BASE_URL = `https://instagram.com/${USERNAME}`;
let response = await request(BASE_URL);
});
请求未成功显示unhandledPromiseRejection错误
相关分类