Error message: “'chromedriver' executable needs to be available in the path”

前端 未结 25 1855
轻奢々
轻奢々 2020-11-22 05:15

I am using selenium with python and have downloaded the chromedriver for my windows computer from this site: http://chromedriver.storage.googleapis.com/index.html?path=2.15/

相关标签:
25条回答
  • 2020-11-22 06:06

    Same situation with pycharm community edition, so, as for cmd, you must restart your ide in order to reload path variables. Restart your ide and it should be fine.

    0 讨论(0)
  • We have to add path string, begin with the letter r before the string, for raw string. I tested this way, and it works.

    driver = webdriver.Chrome(r"C:/Users/michael/Downloads/chromedriver_win32/chromedriver.exe")
    
    0 讨论(0)
  • 2020-11-22 06:10

    When you unzip chromedriver, please do specify an exact location so that you can trace it later. Below, you are getting the right chromedriver for your OS, and then unzipping it to an exact location, which could be provided as argument later on in your code.

    wget http://chromedriver.storage.googleapis.com/2.10/chromedriver_linux64.zip unzip chromedriver_linux64.zip -d /home/virtualenv/python2.7.9/

    0 讨论(0)
  • 2020-11-22 06:11

    When I downloaded chromedriver.exe I just move it in PATH folder C:\Windows\System32\chromedriver.exe and had exact same problem.

    For me solution was to just change folder in PATH, so I just moved it at Pycharm Community bin folder that was also in PATH. ex:

    • C:\Windows\System32\chromedriver.exe --> Gave me exception
    • C:\Program Files\JetBrains\PyCharm Community Edition 2019.1.3\bin\chromedriver.exe --> worked fine
    0 讨论(0)
  • 2020-11-22 06:13

    According to the instruction, you need to include the path to ChromeDriver when instantiating webdriver.Chrome eg.:

    driver = webdriver.Chrome('/path/to/chromedriver')
    
    0 讨论(0)
  • 2020-11-22 06:13

    Could try to restart computer if it doesn't work after you are quite sure that PATH is set correctly.

    In my case on windows 7, I always got the error on WebDriverException: Message: for chromedriver, gecodriver, IEDriverServer. I am pretty sure that i have correct path. Restart computer, all work

    0 讨论(0)
提交回复
热议问题