1.安装浏览器
yum源修改
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
安装
curl https://intoli.com/install-google-chrome.sh | bash
ldd /opt/google/chrome/chrome | grep "not found"
执行:
google-chrome --no-sandbox --headless --disable-gpu --screenshot https://www.baidu.com/
2.安装chromedriver(需要下载与chrome版本匹配的安装包)
下载:https://npm.taobao.org/mirrors/chromedriver/ (opens new window)
3.unzip解压后移至/usr/bin/
mv chromedriver /usr/bin/