WebDriverException:消息:无效参数:无法杀死已退出的进程Selenium python

问题描述

尽管我知道我的问题可能与其他问题相似,但是我遇到了一个严重的问题,在尝试运行代码时出现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

我还阅读了有关版本不兼容的信息,但似乎它们都兼容:

  • Firefox:82.0
  • GeckoDriver:v0.27.0
  • 硒:3.141.0

我很感谢您的帮助,我该如何解决?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)