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 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 CSAPPattacklab
  • ¥15 一直显示正在等待HID—ISP
  • ¥15 Python turtle 画图
  • ¥15 stm32开发clion时遇到的编译问题