小编tri*_*fik的帖子

如何在 Puppeteer 中找到 document.activeElement

我想用 puppeteer 自动填写表格。我填写第一个输入,然后单击一个按钮,然后创建一个具有焦点的新输入字段。

我怎样才能选择这个输入?我可以使用 document.activeElement 吗?如何使用?

  let newActivity = 'button.new_activity'
  await page.waitForSelector(newActivity)
  await page.click(newActivity)

// find active/focused input
await page.type(focusedInput, 'message')

Run Code Online (Sandbox Code Playgroud)

javascript autofill webautomation node.js puppeteer

4
推荐指数
1
解决办法
1508
查看次数

标签 统计

autofill ×1

javascript ×1

node.js ×1

puppeteer ×1

webautomation ×1