我在 docker 环境中遇到错误:
selenium.common.exceptions.SessionNotCreatedException: Message: Unable to find a matching set of capabilities
.
这是我的配置:
Python 3.9.0
selenium==3.141.0
webdriver-manager==3.2.2
pymongo==3.11.0
Mozilla Firefox 78.4.0esr
geckodriver 0.27.0
location for geckodriver:'usr/loca/bin'
我的测试示例代码:
from selenium import `webdriver`
from selenium.webdriver import FirefoxOptions
opts = FirefoxOptions()
opts.add_argument("--headless")
browser = webdriver.Firefox(options=opts)
browser.get('https://stackoverflow.com')