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/
3.unzip解压后移至/usr/bin/
mv chromedriver /usr/bin/
本文详细介绍了如何通过YUM源和shell脚本安装阿里云镜像下的Google Chrome浏览器,并指导了如何安装与之匹配的Chromedriver,以便进行自动化测试。
2192

被折叠的 条评论
为什么被折叠?



