我正在使用puppeteer和node.js来抓取一些数据,但是在尝试循环url列表时遇到了一些问题。当我推送抓取的数据时,我得到了一个错误,说数组没有定义。我认为这个问题与在for循环中使用await有关,但我真的不明白为什么以及如何修复它。为什么它说数组没有定义?下面是我的代码的一个非常简化的版本:
/* Initiate the Puppe
async getEvery(duration, start, end, every = 1, after = true) { return await Promise.all(dates.map((date) => this.getDate(date, after)dater.getEvery()函数调用的SyntaxError: await is only valid in async</em