有人可以帮我解决这个问题,我正在使用 Chromeless 和 Serverless 运行 AWS Lambda,我一直收到同样的错误。
我的代码:
import Chromeless from 'chromeless'
export default async () => {
const chromeless = new Chromeless({
remote: {
endpointUrl: 'https://xxx.execute-api.eu-west-2.amazonaws.com/staging',
apiKey: 'xxx'
},
})
const screenshot = await chromeless
.goto('https://www.google.com')
.type('chromeless', 'input[name="q"]')
.screenshot()
console.log(screenshot)
await chromeless.end()
}
错误:
(node:1) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: Unknown command: protocol
我在网上找不到任何可以提供帮助的东西,所以我将此代码作为测试运行,但它仍然失败,一旦我尝试将任何内容传递到屏幕截图中,它似乎就失败了,它不起作用.evaluate()
或.html()
两者都不起作用。如果有人可以提供帮助,我将不胜感激,我可以提供所需的任何其他文件!