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

前端 未结 25 1917
轻奢々
轻奢々 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:56

    Had this issue with Mac Mojave running Robot test framework and Chrome 77. This solved the problem. Kudos @Navarasu for pointing me to the right track.

    $ pip install webdriver-manager --user # install webdriver-manager lib for python
    $ python # open python prompt
    

    Next, in python prompt:

    from selenium import webdriver
    from webdriver_manager.chrome import ChromeDriverManager
    driver = webdriver.Chrome(ChromeDriverManager().install())
    
    # ctrl+d to exit
    

    This leads to the following error:

    Checking for mac64 chromedriver:xx.x.xxxx.xx in cache
    There is no cached driver. Downloading new one...
    Trying to download new driver from http://chromedriver.storage.googleapis.com/xx.x.xxxx.xx/chromedriver_mac64.zip
    ...
    TypeError: makedirs() got an unexpected keyword argument 'exist_ok'
    
    • I now got the newest download link
      • Download and unzip chromedriver to where you want
      • For example: ~/chromedriver/chromedriver

    Open ~/.bash_profile with editor and add:

    export PATH="$HOME/chromedriver:$PATH"
    

    Open new terminal window, ta-da

提交回复
热议问题