Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Selenium and python : "Message: 'geckodriver' executable needs to be in PATH. "

I was recently working with web automation, with Selenium and python, and I faced into the error almost everyone got.

from selenium import webdriver

window = webdriver.Firefox()
window.get("https://ecoledirecte.com")

But I looked up for several answers, and None of them worked ! I tried the solution for this question, but nothing changed. I checked several times, and the geckodriver is in PATH (I extracted the file into my Downloads folder, then moved the executable into my main folder). I checked if indicating the mozilla geckovriver folder in the calling of webdriver.Firefox() would help (webdriver.Firefox("C:\\Users\\user\\Downloads\\mozilla-geckodriver-9b5f85c")), but no.

Is there any reason for that ?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

I think I once put it in my System32 folder (which is in PATH!) but this is probably a little sketchy. Wherever you put the geckodriver, you just have to add that location to your PATH environment variable.

Try following this instruction:
http://www.learningaboutelectronics.com/Articles/How-to-install-geckodriver-Python-windows.php

I believe you could also install in the same folder where your python file is located – it should probably pick up that folder (but I’m not sure).

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading