【发布时间】:2020-10-24 21:36:21
【问题描述】:
虽然我知道我的问题可能与其他一些问题相似,但我对此有一个严重的问题,我在尝试运行代码时收到 Message: invalid argument: can't kill an exited process 错误。请注意,我在 ubuntu 20 上运行它,它没有显示。
这是我的代码:
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from webdriver_manager.firefox import GeckoDriverManager
from selenium.webdriver.firefox.options import Options
options = Options()
options.headless = True
driver = webdriver.Firefox(executable_path=GeckoDriverManager().install(), options=options)
控制台出错
WebDriverException: Message: invalid argument: can't kill an exited process
这是 geckodriver 日志文件:
1603574335551 geckodriver INFO Listening on 127.0.0.1:59603
1603574336562 mozrunner::runner INFO Running command: "/usr/bin/firefox" "--marionette" "-foreground" "-no-remote" "-profile" "/tmp/rust_mozprofilenqjQeL"
Error: no DISPLAY environment variable specified
我还阅读了有关版本不兼容的信息,但似乎所有版本都兼容:
- 火狐:82.0
- GeckoDriver:v0.27.0
- 硒:3.141.0
感谢您的帮助,我该如何解决?
【问题讨论】:
-
看到这个帖子希望对你有帮助stackoverflow.com/questions/52534658/…
-
@UmairMubeen 它很旧,它提到了旧版本
标签: python selenium ubuntu selenium-webdriver selenium-firefoxdriver