how to install geckodriver on a windows system

后端 未结 5 1038
孤街浪徒
孤街浪徒 2021-02-09 06:07

I am trying to intall webdriver and in order to open firefox i need the geckodriver to be installed and in the correct path.

Firstly the download link to install geckodr

相关标签:
5条回答
  • 2021-02-09 06:35

    I am working with python 3.7.7 under Windows 10 Build 19041.329. After pip-installing selenium into a venv I got an error that demanded that the selenium executeable should be in PATH. I solved this by installing the C++ redistributeables for Windows as recommended in the geckodriver git

    https://github.com/mozilla/geckodriver/releases/tag/v0.26.0

    and just copying the .exe file into my venv folder.

    0 讨论(0)
  • 2021-02-09 06:36

    You can put it anywhere. 1. put it into your project folder. 2. create a folder and put driver into it. Set the driver path up in your code.

      from selenium import webdriver
      path="C:\\Programs\\Python36\\BrowersDriver\\chromedriver.exe"
      driver=webdriver.Chrome(path)
      driver.get("http://www.yahoo.com")
      driver.close()
      driver.quit()
    

    http://kennethhutw.blogspot.sg/2017/03/how-to-install-geckodriver-on-windows.html

    0 讨论(0)
  • 2021-02-09 06:46

    First download GeckoDriver for Windows, extract it and copy the path to the folder.

    • Right-click on My Computer or This PC.
    • Select Properties.
    • Select advanced system settings.
    • Click on the Environment Variables button.
    • From System Variables select PATH.
    • Click on Edit button.
    • Click New button.
    • Paste the path of GeckoDriver file.
    0 讨论(0)
  • 2021-02-09 06:49

    For one make sure you are downloading the one for your OS. Windows is at the bottom of the list it will say win32. Download that file or 64 doesn't matter.

    After that you are going to want to extract the file. If you get an error that says there is no file in the Winrar file, this may be because in your Winrar settings you have Winrar set to not extract any files that have the extension .exe. If you go to Winrar options then settings then security you can delete this it will say *.exe, and after you delete that you can extract the file. After that is done, search how to update the path so that gecko driver can be accessed. Then you will most likely need to restart.

    0 讨论(0)
  • 2021-02-09 06:59

    I've wrestled with the same question for last hour, and finally have a solution, which will hopefully help someone out there (Windows 10, Python 2.7, Anaconda distribution).

    1) This was the issue in my case: make sure you have the latest version of Firefox installed. I had firefox 36, which, when checking for updates, said it was the latest version. Mozilla's website had version 54 as latest. So download firefox from website, and reinstall

    2) Make sure you have the latest gecko driver downloaded

    3) If you're getting the path error - use the code below to figure out which path python is looking at, and pop the geckodriver.exe in there:

    import os
    os.getcwd()
    
    0 讨论(0)
提交回复
热议问题