问题
我有一个在 AWS lambda中运行的网络爬虫,但几周后 AWS lambda 将停止支持 Ruby 2.7。我去年使用本教程构建了我的刮刀。
我需要找到与Ruby 2.7兼容的 chrome 驱动程序和无头 chrome 版本,但我不知道从哪里开始。
我查看了ChromeDriver 的下载门户,但我没有看到任何迹象表明 Chrome 驱动程序适用于 ruby 2.7 或任何其他特定版本的 ruby。
我的代码通过访问 ChromeDriver 二进制文件并在特定文件夹中启动它来工作
我通过运行以下命令下载了我正在使用的特定二进制文件:
# serverless chrome
wget https://github.com/adieuadieu/serverless-chrome/releases/download/v1.0.0-37/stable-headless-chromium-amazonlinux-2017-03.zip
unzip stable-headless-chromium-amazonlinux-2017-03.zip -d bin/
rm stable-headless-chromium-amazonlinux-2017-03.zip
# chromedriver
wget https://chromedriver.storage.googleapis.com/2.37/chromedriver_linux64.zip
unzip chromedriver_linux64.zip -d bin/
rm chromedriver_linux64.zip