1.安装chrome浏览器
配置知识库
[root@tkpadc07116 yum.repos.d]# cat > /etc/yum.repos.d/google-chrome.repo << EOF
> [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
> EOF
安装chrome
yum -y install google-chrome-stabl
2.pip安装selenium
pip install selenium
3.安装chromedriver
wget -N http://npm.taobao.org/mirrors/chromedriver/2.9/chromedriver_linux64.zip
chmod a+x chromedriver
mv -f chromedriver /usr/local/share/chromedriver
ln -s /usr/local/share/chromedriver /usr/local/bin/chromedriver
ln -s /usr/local/share/chromedriver /usr/bin/chromedriver
4.测试
from selenium import webdriver
browser = webdriver.Chrome()
browser.get('http://www.baidu.com/')