我最近将我的 puppeteer 版本从 2.1 更新到了 3.1。我在以前的版本上使用了 pupeteer-firefox。现在由于 pupeteer 3.1 内置了 firefox,我正在使用它。但这只是 pupeteer 的一个实验性功能。
此代码在以前的版本中正常工作。
const elementHandle = await page.$("iframe[src^=\"https://docs.google.com/picker\"] [id=\":7\"]")
await elementHandle.click()
重现步骤
- 登录谷歌:https ://accounts.google.com/ServiceLogin?hl=en&gl=en
- 转到:https ://www.google.com/maps/d/?hl=en&gl=en
- 创建新地图
- 搜索位置并将其添加到地图中
- 单击添加图像图标图像图标
现在将打开一个 iframe。我需要单击id=":7"iframe 内的元素并输入图像 url。有人可以帮我吗?