需要在linux上安装谷歌浏览器和谷歌浏览器驱动
1、安装 chrome
wget https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm
yum install ./google-chrome-stable_current_x86_64.rpm
2、安装 chromedriver
chrome官网
wget https://chromedriver.storage.googleapis.com/2.38/chromedriver_linux64.zip
淘宝源(推荐)
wget http://npm.taobao.org/mirrors/chromedriver/2.41/chromedriver_linux64.zip
将下载的文件解压,放在如下位置
unzip chromedriver_linux64.zip
mv chromedriver /usr/bin/
给予执行权限
chmod +x /usr/bin/chromedriver
chromedriver下载链接:
http://chromedriver.storage.googleapis.com/index.html
报错
Error: Server terminated early with status 127
原因是谷歌浏览器驱动未安装