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

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 任意一个散点图自己下载其js脚本文件并做成独立的案例页面,不要作在线的,要离线状态。
  • ¥30 c#打开word开启修订并实时显示批注
  • ¥15 如何解决ldsc的这条报错/index error
  • ¥15 VS2022+WDK驱动开发环境
  • ¥30 关于#java#的问题,请各位专家解答!
  • ¥30 vue+element根据数据循环生成多个table,如何实现最后一列 平均分合并
  • ¥20 pcf8563时钟芯片不启振
  • ¥20 pip2.40更新pip2.43时报错
  • ¥15 换yum源但仍然用不了httpd
  • ¥50 C# 使用DEVMOD设置打印机首选项