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

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

    I see the discussions still talk about the old way of setting up chromedriver by downloading the binary and configuring the path manually.

    This can be done automatically using webdriver-manager

    pip install webdriver-manager
    

    Now the above code in the question will work simply with below change,

    from selenium import webdriver
    from webdriver_manager.chrome import ChromeDriverManager
    
    driver = webdriver.Chrome(ChromeDriverManager().install())
    

    The same can be used to set Firefox, Edge and ie binaries.

提交回复
热议问题