The use of selenium (deployment environment) in Linux

1, the installation chrome
Google Chrome is installed with the following command
yum install https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm
Alternatively, you can download to the local, and then install
wget https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm
yum install ./google-chrome-stable_current_x86_64.rpm
 
Install the necessary libraries
yum install mesa-libOSMesa-devel gnu-free-sans-fonts wqy-zenhei-fonts
 
2, mounting (attachment at the end of the corresponding version of chrome and chromedriver) chromedriver
chrome official website
wget https://chromedriver.storage.googleapis.com/2.38/chromedriver_linux64.zip
Taobao source (recommended)
wget http://npm.taobao.org/mirrors/chromedriver/2.41/chromedriver_linux64.zip
 
Unzip the downloaded file, put the following location
unzip chromedriver_linux64.zip
mv chromedriver /usr/bin/
Give execute permissions
chmod +x /usr/bin/chromedriver
 
3, run the code to see if the success (python under)
from selenium import webdriver
driver = webdriver.Chrome()
 
------------ 2019 ----------- compatible version comparison table
ChromeDriver 78.0.3904.11 (2019-09-12)---------Supports Chrome version 78
ChromeDriver 77.0.3865.40 (2019-08-20)---------Supports Chrome version 77
ChromeDriver 76.0.3809.12 (2019-06-07)---------Supports Chrome version 76
ChromeDriver 75.0.3770.8 (2019-04-29)---------Supports Chrome version 75
ChromeDriver v74.0.3729.6 (2019-03-14)--------Supports Chrome v74
ChromeDriver v2.46 (2019-02-01)----------Supports Chrome v71-73

Guess you like

Origin www.cnblogs.com/tulintao/p/11719748.html