Linux+Selenium
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,看是否可单独启动。
2、ERROR:ozone_platform_x11.cc(234)] Missing X server or $DISPLAY
/usr/bin/google-chrome
Fontconfig warning: "/etc/fonts/fonts.conf", line 86: unknown element "blank"
[14590:14590:0310/170706.251474:ERROR:ozone_platform_x11.cc(234)] Missing X server or $DISPLAY
[14590:14590:0310/170706.251535:ERROR:env.cc(225)] The platform failed to initialize. Exiting.
更多推荐
所有评论(0)