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')