【问题标题】:running google chrome headless on ec2 ubuntu server在 ec2 ubuntu 服务器上运行 google chrome headless
【发布时间】:2020-11-01 01:24:39
【问题描述】:

您好,我有一个 ec2 服务器,这是配置:

DNS 公共 (IPv4):ec2-18-191-6-130.us-east-2.compute.amazonaws.com

ID d'AMI:ubuntu/images/hvm-ssd/ubuntu-bionic-18.04-amd64-server-20200611 (ami-0a63f96e85105c6d3)

当我尝试安装 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

我表示我按照这个简单的教程在我的 ec2 服务器上安装 chrome: https://understandingdata.com/install-google-chrome-selenium-ec2-aws/

【问题讨论】:

    标签: amazon-web-services google-chrome amazon-ec2


    【解决方案1】:

    我尝试复制并遇到与您相同的问题。但是另一种方法对我有用。你可以试试,最好是在新的 ubuntu 实例上。

    安装前置要求

    sudo apt update
    sudo apt install unzip libnss3 python3-pip
    

    安装driver for chrome 83

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

    安装 google-chrome-stable 当前版本 (83)

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

    检查安装

    google-chrome-stable --version
    

    安装硒

    pip3 install selenium --user
    

    在我的测试中安装成功,但我尚未验证 selenium 是否按预期工作。我只关注chromeselenium是否安装。

    【讨论】:

    • 不幸的是我尝试了你的方法它对我没有任何改变我有同样的错误
    • @ahmedaao 你在一个新的 ubuntu 实例上试过了吗?以前,它在我启动干净实例之前不起作用。
    • 很好的答案 - 非常感谢
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-10-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多