Debian 10:Selenium firefox_驱动程序与firefox ESR不兼容

2024-05-15 13:41:56 发布

您现在位置:Python中文网/ 问答频道 /正文

在Debian 10中,由于与firefox ESR不兼容,firefox_驱动程序从Synaptic中删除。我从GitHub下载了最新的geckodriver,还安装了最新的Firefox(使用flatpak)。我在调用webdriver.Firefox()时收到此错误消息:

SessionNotCreatedException: Unable to find a matching set of capabilities

如何从Python运行firefox

版本

Firefox 80.0.1 (installed from flatpak)
geckodriver 0.27 (in /usr/local/bin/)
Selenium,3.14.1
Python 3.7.3

脚本:

from selenium import webdriver
driver = webdriver.Firefox()
driver.get("http://www.python.org")
assert "Python" in driver.title

Tags: infromgithub消息driver错误驱动程序debian