Ubuntu Selenium NoGUI


With Chrome

Install Chrome

sudo apt-get update
sudo apt-get install -y libappindicator1 fonts-liberation libatk-bridge2.0-0 libatspi2.0-0 libgbm1 libgtk-3-0 libxkbcommon0 libxshmfence1 xdg-utils
cd /tmp
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo dpkg -i google-chrome*.deb 
sudo apt --fix-broken install

Install Driver

Chrome驱动尽量到官方网站去下载:https://sites.google.com/a/chromium.org/chromedriver/downloads
但是没有梯子的话,可以使用备用国内镜像:https://npm.taobao.org/mirrors/chromedriver

cp chromedriver /usr/bin/
cp chromedriver /usr/local/bin/

Check Chrome

google-chrome --version
google-chrome-stable --version

With Firefox

Install Firefox

sudo apt update 
sudo apt install firefox

Install Driver

geckodriver

see:https://selenium.dev/selenium/docs/api/py/

Officia:https://github.com/mozilla/geckodriver/releases

cp geckodriver /usr/bin/ 
cp geckodriver /usr/local/bin/

发表评论

您的电子邮箱地址不会被公开。 必填项已用*标注