我尝试将Puppeteer用作以下代码,但收到错误消息:
`const ssClick =异步函数(页面,元素){
等待页面。addScriptTag({
path:path.join(__ dirname,'../../ node_modules / query-selector-shadow-dom / dist / querySelectorShadowDom.js')
});
var btn =(await page.waitForFunction(()=> {
返回querySelectorShadowDom.querySelectorDeep(element) }))。asElement()
等待btn.click();`
评估失败:ReferenceError:元素未定义