gpt4 book ai didi

node.js - 无法将 google-play-scraper 的结果分配给变量

转载 作者:搜寻专家 更新时间:2023-10-31 23:56:33 25 4
gpt4 key购买 nike

来自 npm 包:https://www.npmjs.com/package/google-play-scraper我试图将抓取的结果分配给一个变量。但是没办法。

var gplay = require("google-play-scraper");
var app = gplay.app({ appId: "com.google.android.youtube" });
console.log(app);

上面的代码会打印出来

Promise { <pending> }

关于如何分配它的任何想法?谢谢

最佳答案

var app = gplay.app({ appId: "com.google.android.youtube" });
app.then((result)=>console.log(result.title))

必须使用then打印结果(已解决)

The then() method returns a Promise. It takes two arguments: callback functions for the success and failure cases of the Promise.

关于node.js - 无法将 google-play-scraper 的结果分配给变量,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56000509/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com