【发布时间】:2017-05-21 05:59:35
【问题描述】:
一些系统更新后,我无法使用 Firefox 运行 webdriver
from selenium import webdriver
driver = webdriver.Firefox()
我得到以下异常:
selenium.common.exceptions.WebDriverException:
Message:
Expected browser binary location, but unable to find binary in default location,
no 'moz:firefoxOptions.binary' capability provided,
and no binary flag set on the command line
所以我想知道default location 是什么,更重要的是,它在哪里定义(脚本名称),以便我可以设置新值或使用 exists 将二进制文件复制到其中?我在PyCharm 中使用调试器找到了一些提示,但没有运气......
当前Firefox 安装到C:\Program Files (x86)\Mozilla Firefox
附:我知道我可以使用Firefox Profile、FirefoxBinary、指定geckodriver.exe 的路径等,但我不是在寻找这种解决方案
【问题讨论】:
标签: python selenium firefox selenium-webdriver