Dennis__wu 2018-08-11 07:09 采纳率: 0%
浏览 1858
已结题

linux 执行python 异常 WebDriverException

python执行日志:
[root@localhost opt]# python ./tbacnt_check.py
Traceback (most recent call last):
File "./tbacnt_check.py", line 36, in
driver = webdriver.Firefox(profile)
File "/usr/local/lib/python3.5/site-packages/selenium/webdriver/firefox/webdriver.py", line 167, in init
keep_alive=True)
File "/usr/local/lib/python3.5/site-packages/selenium/webdriver/remote/webdriver.py", line 156, in init
self.start_session(capabilities, browser_profile)
File "/usr/local/lib/python3.5/site-packages/selenium/webdriver/remote/webdriver.py", line 251, in start_session
response = self.execute(Command.NEW_SESSION, parameters)
File "/usr/local/lib/python3.5/site-packages/selenium/webdriver/remote/webdriver.py", line 320, in execute
self.error_handler.check_response(response)
File "/usr/local/lib/python3.5/site-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: Process unexpectedly closed with status: 1

下面是火狐 驱动日志
[root@localhost opt]# cat geckodriver.log
1533960909134 geckodriver INFO geckodriver 0.19.1
1533960909139 geckodriver INFO Listening on 127.0.0.1:58648
1533960910337 mozrunner::runner INFO Running command: "/usr/bin/firefox" "-marionette" "-profile" "/tmp/rust_mozprofile.YfTd8Xc4aSZ4"
Error: no DISPLAY environment variable specified

  • 写回答

2条回答

  • 申哲 2018-08-11 07:50
    关注

    看这个报错好像是环境变量的问题,建议查看一下环境变量,不行的话重新配置一下环境变量,
    终端输入:echo $PATH 可以查看环境变量

    评论

报告相同问题?

悬赏问题

  • ¥15 逻辑谓词和消解原理的运用
  • ¥15 请求分析基于spring boot+vue的前后端分离的项目
  • ¥15 三菱伺服电机按启动按钮有使能但不动作
  • ¥15 js,页面2返回页面1时定位进入的设备
  • ¥200 关于#c++#的问题,请各位专家解答!网站的邀请码
  • ¥50 导入文件到网吧的电脑并且在重启之后不会被恢复
  • ¥15 (希望可以解决问题)ma和mb文件无法正常打开,打开后是空白,但是有正常内存占用,但可以在打开Maya应用程序后打开场景ma和mb格式。
  • ¥20 ML307A在使用AT命令连接EMQX平台的MQTT时被拒绝
  • ¥20 腾讯企业邮箱邮件可以恢复么
  • ¥15 有人知道怎么将自己的迁移策略布到edgecloudsim上使用吗?