centos 安装chrome以及chromedriver

chrome安装和chromedriver下载
chrome下载安装
yum install https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm

chromedriver下载,我下载的是最新版本。chrome也是最新版本
https://npm.taobao.org/mirrors/chromedriver/2.40/chromedriver_linux64.zip
 

或者 以下

centos7 安装 google-chrome
(1) 添加chrome的repo源
 vi /etc/yum.repos.d/google.repo

[google]name=Google-x86_64baseurl=http://dl.google.com/linux/rpm/stable/x86_64enabled=1gpgcheck=0gpgkey=https://dl-ssl.google.com/linux/linux_signing_key.pub

(2)安装
yum update , 然后yum install google-chrome-stable

这时候在非root账号下运行google-chrome会输出没有显示器,无法启动之类的。

不知道为什么不能在非root账号下运行。

所以在运行时一定要切换到ROOT用户!!!

2, 安装Xvfb
yum update

yum install Xvfb

yum install libXfont

yum install xorg-x11-fonts*

(2)下载chromedriver

从https://sites.google.com/a/chromium.org/chromedriver/home下载chromedriver

配置在PATH路径或者在脚本中指定路径  

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值