【发布时间】:2020-05-26 01:05:55
【问题描述】:
我目前正在尝试使用 Puppeteer 上传图像,但是当我尝试打开 FileChooser 时:
你们都认识这个人 https://i.stack.imgur.com/aRApS.png 这是一个示例图片
要浏览并选择文件,我在控制台中收到以下错误
TypeError: undefined is not a function
然后是预期的超时错误
TimeoutError: waiting for waiting for file chooser failed: timeout 30000ms exceeded
问题是……为什么是未定义的?我哪里出错了?这是我的代码:
const [fileChooser] = Promise.all([
page.waitForFileChooser(),
page.click("input#EventImage"),
]);
await fileChooser.accept([
__dirname + "/screenshot.png",
]);
在这之前的一切都很好
Puppeteer 版本:3.1.0
【问题讨论】:
标签: node.js google-chrome automation puppeteer