Selenium+Linux
开源社区已无CentOS7.0以下rpm维护。升级测试机器到CentOS7.X。
Selenium安装
python环境:pip3 install selenium
浏览器插件:http://chromedriver.storage.googleapis.com/index.html
yum instlal google-chrome
使用以下命令确定是否安装成功,显示以下信息表示安装成功
google-chrome-stable --no-sandbox --headless --disable-gpu --screenshot 百度一下,你就知道
yum install chromedriver.x86_64
也可携带chrome driver,单独运行chrome drive报successfully说明安装成功。
运行遇到问题
selenium调用Chromedriver:
-
The process started from chrome location /usr/bin/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.
单独调试google-chrome,看是否可单独启动。