centos 安裝谷歌瀏覽器和selenium環(huán)境
1,安裝谷歌瀏覽器
vi?/etc/yum.repos.d/google-chrome.repo
name=google-chrome baseurl=https://dl.google.com/linux/chrome/rpm/stable/x86_64 enabled=1 gpgcheck=1 gpgkey=https://dl.google.com/linux/linux_signing_key.pub
yum -y install google-chrome-stable --nogpgcheck
2,安裝selenium
yum -y install epel-release
yum install python-pip -y
pip2.7 install? selenium
?
注意:
1,運行要用headless模式運行
chrome_options.add_argument('--headless')
2,root身份運行添加
chrome_options.add_argument('--no-sandbox')
原文鏈接:https://www.dianjilingqu.com/459472.html
標(biāo)簽: