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

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

    For Linux and OSX

    Step 1: Download chromedriver

    # You can find more recent/older versions at http://chromedriver.storage.googleapis.com/
    # Also make sure to pick the right driver, based on your Operating System
    wget http://chromedriver.storage.googleapis.com/81.0.4044.69/chromedriver_mac64.zip
    

    For debian: wget https://chromedriver.storage.googleapis.com/2.41/chromedriver_linux64.zip

    Step 2: Add chromedriver to /usr/local/bin

    unzip chromedriver_mac64.zip
    sudo mv chromedriver /usr/local/bin
    sudo chown root:root /usr/local/bin/chromedriver
    sudo chmod +x /usr/local/bin/chromedriver
    

    You should now be able to run

    from selenium import webdriver
    
    browser = webdriver.Chrome()
    browser.get('http://localhost:8000')
    

    without any issues

提交回复
热议问题