1, CentOS
2, Python3
3, Pip3
4, 代码增加实例化配置,并确执行结束后quit掉实例
chrome_options = Options()
chrome_options.add_argument('--headless')
chrome_options.add_argument('--no-sandbox')
chrome_options.add_argument('--disable-dev-shm-usage')
driver = webdriver.Chrome('/path/to/your_chrome_driver_dir/chromedriver',options=chrome_options)
5, 安装crhome_driver,必须保持chrome与driver版本一致,版本参考:https://blog.csdn.net/BinGISer/article/details/88559532
cd /usr/local/share
wget -N http://chromedriver.storage.googleapis.com/78.0.3904.70/chromedriver_linux64.zip
unzip chromedriver_linux64.zip
chmod +x chromedriver
ln -s /usr/local/share/chromedriver /usr/local/bin/chromedriver
ln -s /usr/local/share/chromedriver /usr/bin/chromedriver
6, 查看版本
chromedriver --version
7, 安装chrome
yum install chromium
8, 安装依赖
yum install GConf2