木偶页面。未定义评估页面

时间:2020-07-17 12:55:30

标签: javascript node.js puppeteer

我想在带有puppeteer的输入中键入内容,但它返回一个错误:未定义页面

If a collection configuration is specified when updating the chaincode definition, a definition for each of the existing collections must be included

我不能使用'document.getElementById('i0116')。value ='prova';'

1 个答案:

答案 0 :(得分:4)

您不能在page.evaluate中使用page或page.type。

所以正确的方法是这样,

await page.type('#i0116','prova', {delay:200})
await page.evaluate(async() =>{
  document.getElementById('idSIButton9').click();
})

或使用本机页面。单击puppeteer中的api,

await page.type('#i0116','prova', {delay:200})
await page.click('#idSIButton9')