Can't use chrome driver for Selenium

后端 未结 12 1199
鱼传尺愫
鱼传尺愫 2020-12-01 03:57

I\'m having trouble using the Chrome driver for Selenium. I have the chromedriver downloaded and saved to C:\\Chrome:

driver = webdriver.Chrome(executable_pa         


        
12条回答
  •  一个人的身影
    2020-12-01 04:16


    For Linux

    1. Check you have installed latest version of chrome browser-> "chromium-browser -version"
    2. If not, install latest version of chrome "sudo apt-get install chromium-browser"
    3. Get the appropriate version of chrome driver from http://chromedriver.storage.googleapis.com/index.html
    4. Unzip the chromedriver.zip
    5. Move the file to /usr/bin directory sudo mv chromedriver /usr/bin
    6. Goto /usr/bin directory and you would need to run something like "chmod a+x chromedriver" to mark it executable.
    7. finally you can execute the code.

    from selenium import webdriver
    driver = webdriver.Chrome()
    driver.get("http://www.google.com")
    display.stop()
    

提交回复
热议问题