尝试通过webdriver运行firefox,但是firefox无法运行。正确指定所有内容(firefox路径),即使什么也没有发生。 非常感谢您的帮助。
[*] geckodriver.exe已移至/ usr / bin
from selenium import webdriver
from selenium.webdriver.firefox.options import Options
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
from selenium.webdriver.firefox.firefox_binary import FirefoxBinary
binary = FirefoxBinary("C:\Program Files\Mozilla Firefox\Firefox.exe")#path of Firefox.exe
driver = webdriver.Firefox(firefox_binary=binary)
driver.get("https://google.com")
答案 0 :(得分:1)
您必须将驱动程序放入PATH,或者可以指定驱动程序的路径。
driver = webdriver.Firefox(executable_path="path\to\geckodriver.exe")
如果没有,可以从here下载它,并将其放在python文件夹中。