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

Time:06-07

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 ?

CodePudding user response:

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).

  • Related