尝试在 AWS Ec2 上部署 pyautogui 爬虫

Trying to deploy a pyautogui crawler on AWS Ec2

我是 AWS 的新手,我正在尝试在 ubuntu 18.04 ec2 实例上部署一个 pyautogui 爬虫。

但是当我尝试安装 google chrome 时出现严重错误。

我使用本教程安装了所有软件包https://understandingdata.com/install-google-chrome-selenium-ec2-aws/但仍然出现错误。

当 运行 以下代码出现此错误时。

google-chrome – version && which google-chrome
cat: relocation error: /opt/google/chrome/lib/libc.so.6: symbol _dl_starting_up version GLIBC_PRIVATE not defined in file ld-linux-x86-64.so.2 with link time reference
cat: relocation error: /opt/google/chrome/lib/libc.so.6: symbol _dl_starting_up version GLIBC_PRIVATE not defined in file ld-linux-x86-64.so.2 with link time reference

而且我不知道如何在无界面服务器上“打开”这个 chrome 选项卡。

感谢任何帮助。如果需要更多信息,请告诉我。

您遵循的说明适用于 Amazon Linux,而非 Ubuntu。以下是适用于 Ubuntu 的步骤(您可能需要从一个新实例开始):

sudo apt update
sudo apt install unzip libnss3

cd /tmp/
wget https://chromedriver.storage.googleapis.com/80.0.3987.106/chromedriver_linux64.zip
unzip chromedriver_linux64.zip
sudo mv chromedriver /usr/bin/chromedriver
chromedriver -version


wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo apt install ./google-chrome-stable_current_amd64.deb

然后

google-chrome -version && which google-chrome

给出:

Google Chrome 85.0.4183.83 
/usr/bin/google-chrome