geckodriver环境变量配置问题
selenium吧
全部回复
仅看楼主
level 1
chocho♬ 楼主
from selenium import webdriver
from selenium.webdriver.firefox.firefox_binary import FirefoxBinary
caps = webdriver.DesiredCapabilities().FIREFOX
caps["marionette"] = True
binary = FirefoxBinary(r'E:\firefoxBro\firefox.exe')
# 把上述地址改成你电脑中Firefox程序的地址
driver = webdriver.Firefox(firefox_binary=binary, capabilities=caps)
driver.get("http://www.santostang.com/2017/03/02/hello-world/")
以上代码老是报这个错:
selenium.common.exceptions.WebDriverException: Message: 'geckodriver' executable needs to be in PATH.
望大神帮帮忙!
2018年01月09日 05点01分 1
level 1
geckodriver没有下载放到python的目录下应该
2018年06月06日 05点06分 2
selenium3版本,webdriver需要自己下载的,并且必须放在python的目录下。折腾了好久才弄明白
2019年09月01日 11点09分
1