CentOS7 安装Chrome的方法

1.配置yum下载源:html

在目录 /etc/yum.repos.d/ 下新建文件 google-chrome.repolinux

[root@localhost ~]#  cd /ect/yum.repos.d/ [root@localhost yum.repos.d]# vim google-chrome.repo

编辑google-chrome.repo,内容以下,,编辑后保存退出(:wq)chrome

[google-chrome] name=google-chrome baseurl=http://dl.google.com/linux/chrome/rpm/stable/$basearch
enabled=1 gpgcheck=1 gpgkey=https://dl-ssl.google.com/linux/linux_signing_key.pub

安装google chrome浏览器:vim

[root@localhost yum.repos.d]# yum -y install google-chrome-stable --nogpgcheck

查看浏览器版本api

google-chrome --version

2.驱动的安装浏览器

下载地址google

https://chromedriver.storage.googleapis.com/index.html

找到相应的驱动发到 /usr/bin/url

mv chromedriver /usr/bin/

查看所属权限spa

ls -l chromedriver

赋予执行权限并将其赋给要执行的用户code

chmod 755 /usr/bin/chromedriver chown xxx:xxx /usr/bin/chromedriver

此上操做就可用程序自动化调用谷歌浏览器

相关文章
相关标签/搜索