selenium 安装

  21 Apr 2018


driver

# chromedriver
https://sites.google.com/a/chromium.org/chromedriver/
http://chromedriver.storage.googleapis.com/index.html
# geckdriver
https://github.com/mozilla/geckodriver/releases


chmod +x chromedriver

ln -s /data/driver/chromedriver /usr/local/bin/chromedriver
ln -s /data/driver/chromedriver /usr/bin/chromedriver

# 安装chrome(chrome版本和driver版本需要对应)
yum install https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm

// 默认安装位置
/opt/google/chrome

ln -s /opt/google/chrome/chrome  /usr/local/bin/chrome
ln -s /opt/google/chrome/chrome  /usr/bin/chrome

// .bashrc
export PATH=/opt/google/chrome:$PATH

chrome -version

# 安装firefox
// 去官网下载对应版本
tar jxvf Firefox-latest-x86_64.tar.bz2 -C /opt/

ln -s /opt/firfox/firfox /usr/local/bin/firefox
ln -s /opt/firfox/firfox /usr/bin/firefox


# 安装chromium
yum install chromium
chromium-browser -version
// 部分chromium配置可修改
vim /usr/lib64/chromium-browser/chromium-browser.sh


# 中文语言包
locale 	// 查看当前系统语言包
yum groupinstall "fonts"	// 安装
# 编辑/etc/locale.conf 修改 LANG=zh_CN.UTF-8 
LANG="zh_CN.GB18030"
LANGUAGE="zh_CN.GB18030:zh_CN.GB2312:zh_CN"
SUPPORTED="zh_CN.UTF-8:zh_CN:zh:en_US.UTF-8:en_US:en"

soure /etc/locale.conf