1.从Google下载最新版的 Chrome:
curl https://intoli.com/install-google-chrome.sh | bash
wget https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm
sudo yum install ./google-chrome-stable_current_*.rpm
sudo yum install ./google-chrome-stable_current_*.rpm
用以下命令查看是否安装成功:
google-chrome –version
2、安装chromedriver:
sudo apt-get install unzip
wget -N http://chromedriver.storage.googleapis.com/2.26/chromedriver_linux64.zip -->2.26是chromedriver的版本号,记得一定要换成和谷歌浏览器对应版本的版本号
unzip chromedriver_linux64.zip
chmod +x chromedriver
sudo mv -f chromedriver /usr/local/share/chromedriver
sudo ln -s /usr/local/share/chromedriver /usr/local/bin/chromedriver
sudo ln -s /usr/local/share/chromedriver /usr/bin/chromedriver
chromedriver版本号一定要和chrome的版本对应,否则chrome会启不来报错。
查看是否安装成功:chromedriver -version