在目录 /etc/yum.repos.d/ 下新建文件 google-chrome.repo
内容如下:
1 2 3 4 5 6 |
[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 |
yum -y install google-chrome-stable –nogpgcheck
安装后查看安装目录:
which google-chrome-stable
which google-chrome
查看版本号:
google-chrome –version
如果想看更多内容就用
google-chrome –help #会列出所有参数
然而在使用selenium +chrome时有报错:
1 2 |
raise exception_class(message, screen, stacktrace) selenium.common.exceptions.WebDriverException: Message: unknown error: DevToolsActivePort file doesn't exist |
需要多加二个参数:
1 2 |
chrome_options.add_argument('--no-sandbox') chrome_options.add_argument('--disable-dev-shm-usage') |
其它参数有:
[‘–headless’, ‘–disable-gpu’, ‘–no-sandbox’, ‘–disable-extensions’, ‘–disable-dev-shm-usage’]
到这其实安装完后通过vnc登录进去也开不开,可以参考这篇解决:
https://blog.csdn.net/tiandaochouqin99/article/details/79643248