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

前端 未结 25 1904
轻奢々
轻奢々 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 05:55

    Before you add the chromedriver to your path, make sure it's the same version as your browser.

    If not, you will need to match versions: either update/downgrade you chrome, and upgrade/downgrade your webdriver.

    I recommend updating your chrome version as much as possible, and the matching the webdriver.

    To update chrome:

    • On the top right corner, click on the three dots.
    • click help -> About Google Chrome
    • update the version and restart chrome

    Then download the compatible version from here: http://chromedriver.chromium.org/downloads .

    Note: The newest chromedriver doesn't always match the newest version of chrome!

    Now you can add it to the PATH:

    1. create a new folder somewhere in your computer, where you will place your web drivers. I created a folder named webdrivers in C:\Program Files

    2. copy the folder path. In my case it was C:\Program Files\webdrivers

    3. right click on this PC -> properties:

    1. On the right click Advanced System settings
    2. Click Environment Variables
    3. In System variables, click on path and click edit
    4. click new
    5. paste the path you copied before
    6. click OK on all the windows

    Thats it! I used pycharm and I had to reopen it. Maybe its the same with other IDEs or terminals.

提交回复
热议问题