how to install geckodriver on a windows system
Asked Answered
D

6

8

I am trying to install 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 geckodriver only allows you to install a file that is not an executable. So is there a way to make it an executable?

Secondly I have tried to change my path variables in command prompt, but of course it didn't work. I then changed the user variable, not the system path variables, because there is no Path in system. there is a Path in user variables so I edited that to change where the file is located.

I have extracted the geckodriver rar file and have received a file with no extension. I don't know how you can have a file with no extension, but they did it. The icon is like a blank sheet of paper with a fold at the top left.

If anyone has a solution for this including maybe another package that is like webdriver and will allow me to open a browser and then refresh the page after a given amount of time. This is all I want to do.

Danica answered 1/3, 2017 at 5:46 Comment(4)
Are you sure you didn't find any executable here (first result on Google). What is your OS ?Mime
yes thats where i downloaded it from I have downloaded every single version on that website it is a rar file and when extracted is a nothing file @ettore rizzaDanica
Ok, after further research I have figured out that I have indeed not been downloading the correct one for my system, sorry sometimes im an idiot. However now a new problem has occurred. Whenever I try to extract the file it gives me a Winrar diagnostics error saying that there is nothing to extract. upon looking into the .rar file I can definitely see that there is in fact an executable file in there, but it will not let me take it out of the .rar. Please helpDanica
and my os is windows 10 @EttoreRizzaDanica
D
6

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.

Danica answered 1/3, 2017 at 21:53 Comment(0)
G
10

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.
Gaberdine answered 7/7, 2019 at 22:51 Comment(0)
A
7

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

Archilochus answered 3/3, 2017 at 6:39 Comment(1)
geckodriver, not chromedriver!Antilogy
D
6

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.

Danica answered 1/3, 2017 at 21:53 Comment(0)
B
0

I've wrestled with the same question for last hour.

  1. 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. Add the geckodriver.exe to the working directory.

import os

os.getcwd()

Brooklyn answered 25/10, 2017 at 8:5 Comment(3)
os.getcwd() just gets the current working directory, not the contents of PATHMobley
@CoreyGoldberg Dear Genius, that's why the author said " pop the geckodriver.exe in there" Love, another Genius ;)Spinose
Sorry, original post had too much slang, I made it clearer. Regards, -Bad WriterBrooklyn
I
0

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.

Ivonneivor answered 19/6, 2020 at 15:39 Comment(0)
H
0
  1. List item download GeckoDriver for Windows download geckodriver screenshot
  2. Extract it and copy the path to the folder, let's use 'D:\tools\gecko' as example
  3. Right-click on 'My Computer' or 'This PC' icon.
  4. Select Properties from the drop down menu.
  5. Select 'Advanced' tab. advances tab screenshot
  6. Click on the Environment Variables button.
  7. Locate System Variables area
  8. Select 'Path' variable
  9. Click on Edit button.
  10. Click New button.
  11. Paste the path to the GeckoDriver folder. 'D:\tools\gecko')edit environment variable screenshot
  12. doublecheck you did everything right :
  13. Open console (cmd.exe)
  14. type geckodriver (file name you've downloaded)
  15. in case path was added successfully it will show you an error, see next screenshot cmd.exe screenshot
Heddie answered 17/7, 2023 at 0:8 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.