我无法对剧作家使用幽灵光标
const page = await context.newPage()
const cursor = await createCursor(page)
await cursor.click(buttonSelector)
结果:
TypeError: Cannot read properties of undefined (reading 'objectId')
最佳答案
参数中需要发送的不是选择器而是boundingBox。 像:
await cursor.click(await cursor.getElemBoundingBox(buttonSelector))
或者:
await cursor.click(await buttonElement.boundingBox())
关于javascript - 如何与剧作家一起使用幽灵光标,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/72659773/