小编Jon*_*des的帖子

Selenium Python(3.141.0、Geckodriver 0.30.0)无法打开 Firefox Webdriver:“无法加载您的 Firefox 配置文件,它可能丢失或无法访问。”

已修复:将 Ubuntu 21.04 升级到 21.10 时,firefox(之前使用 apt 安装)被删除并使用 snap 版本安装。逆向(卸载 snap 版本并使用 apt 重新安装)这解决了我的问题。

在 dist 升级后我必须将 Firefox 重置为默认浏览器后,我应该进行调查。


当尝试使用 Selenium for Python 创建 Firefox Webdriver 时,我收到以下消息: “您的 Firefox 配置文件无法加载,它可能丢失或无法访问。” 单击“确定”后,将出现以下堆栈跟踪:

>>> foo = webdriver.Firefox()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/jonathan/.local/lib/python3.9/site-packages/selenium/webdriver/firefox/webdriver.py", line 170, in __init__
    RemoteWebDriver.__init__(
  File "/home/jonathan/.local/lib/python3.9/site-packages/selenium/webdriver/remote/webdriver.py", line 157, in __init__
    self.start_session(capabilities, browser_profile)
  File "/home/jonathan/.local/lib/python3.9/site-packages/selenium/webdriver/remote/webdriver.py", line 252, in start_session
    response = self.execute(Command.NEW_SESSION, parameters)
  File "/home/jonathan/.local/lib/python3.9/site-packages/selenium/webdriver/remote/webdriver.py", line 321, in execute
    self.error_handler.check_response(response) …
Run Code Online (Sandbox Code Playgroud)

python-3.x selenium-firefoxdriver

6
推荐指数
1
解决办法
3555
查看次数

标签 统计

python-3.x ×1

selenium-firefoxdriver ×1