gpt4 book ai didi

python - selenium.common.exceptions.WebDriverException : Message: 'Geckodriver' executable may have wrong permissions using GeckoDriver Firefox Selenium Python

转载 作者:行者123 更新时间:2023-12-03 09:43:01 25 4
gpt4 key购买 nike

当我尝试执行我的第一个 Selenium/python 代码时出现此错误。

selenium.common.exceptions.WebDriverException: Message: 'Geckodriver' executable may have wrong permissions.



我的代码:
from selenium import webdriver
from selenium.webdriver.firefox.firefox_binary import FirefoxBinary

if __name__ == '__main__':

binary = FirefoxBinary('C:\Program Files (x86)\Mozilla Firefox\firefox.exe')
driver = webdriver.Firefox(firefox_binary=binary,
executable_path="C:\\Users\\mohammed.asif\\Geckodriver")


driver=webdriver.Firefox()

driver.get("www.google.com");

最佳答案

驱动程序路径设置不正确,您需要设置路径直到.exe,如下所示

driver = webdriver.Firefox(firefox_binary=binary,
executable_path="C:\\Users\\mohammed.asif\\Geckodriver\\geckodriver.exe")

关于python - selenium.common.exceptions.WebDriverException : Message: 'Geckodriver' executable may have wrong permissions using GeckoDriver Firefox Selenium Python,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46682841/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com