【发布时间】:2021-06-02 15:06:46
【问题描述】:
我陷入了一个问题。我需要在 AWS lambda 上做一些抓取工作,所以我按照下面提到的博客及其代码库作为起点,这非常有帮助,并且在运行时环境的 AWS lambda 上对我来说工作得非常好:Python 3.6
https://manivannan-ai.medium.com/python-selenium-on-aws-lambda-b4b9de44b8e1 https://github.com/ManivannanMurugavel/selenium-python-aws-lambda
然后我遇到了一个问题,即上面使用的示例代码无法在点击时下载文件。查看互联网后,我知道 62 版本的 chrome 驱动程序和 chromium 二进制文件不支持此功能。所以我开始寻找更高版本的二进制文件。我已经使用了几个二进制文件(chrome 驱动程序和 chromium),显然是兼容的对,但对于所有这些,我都无法成功并且出现以下相同的错误。
我已经尝试了这个 repo 中提供的二进制文件,但对我不起作用。
https://github.com/vittorio-nardone/selenium-chromium-lambda
这些是我尝试过不同版本但对我不起作用的其他来源。
https://chromium.cypress.io/ https://github.com/adieuadieu/serverless-chrome/releases
"errorMessage": "Message: unknown error: Chrome failed to start: exited abnormally.\n (chrome not reachable)\n (The process started from chrome location /opt/chromium is no longer running, so ChromeDriver is assuming that Chrome has crashed.)\n",
互联网/论坛上的人说这个错误是由于 chrome 驱动程序和 chromium 二进制文件之间的版本不兼容。但是我已经仔细考虑了这一点,但仍然没有成功。请指导我如何使它工作。提前致谢。
【问题讨论】:
标签: python amazon-web-services selenium aws-lambda