selenium+python 报错:Expected browser binary location, but unable to find binary in default location……
·
报错: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
原因:未找到浏览器的位置
解决办法:
from selenium.webdriver.firefox.firefox_binary import FirefoxBinary
binary = FirefoxBinary('path/to/firefox.exe')
driver = webdriver.Firefox(firefox_binary=binary)更多推荐



所有评论(0)