1、安装google-chrome 和对应版本的 chromedriver
官网下载linux rpm包 https://www.google.cn/chrome/
rpm安装:rpm -ivh google-chrome-stable_current_x86_64.rpm
问题:安装提示依赖?
解决:yum localinstall google-chrome-stable_current_x86_64.rpm --nogpgcheck
下载对应chrome版本的Chromedriver包 https://npm.taobao.org/mirrors/chromedriver/ http://chromedriver.storage.googleapis.com/index.html
解压chromedriver后,复制到/user/bin/目录下
2、修改Python库 snapshot_selenium下snapshot.py文件
目录:/usr/local/lib/python3.6/site-packages/snapshot_selenium下
增加 snapshot.py文件 方法:get_chrome_driver(): options.add_argument("--no-sandbox") # 以root权限运行不然会报错