0

I started learning selenium, and when I ran this code...

 from selenium import webdriver browser = webdriver.Firefox() print(type(browser)) 

When I ran that code, I got this error - Message: 'geckodriver' executable needs to be in PATH.

How can I fix this error? I'm working on Firefox 64bit, and my Selenium Version is '3.141.0'.

2 Answers 2

1

gekodriver is detected in the 3 following ways.

1. Using environment variable PATH

Add the absolute path to the gekodriver directory into the environmental variable PATH.

export PATH=PATH:/ABSOLUTE/PATH/TO/PARENT_DIRECTORY_OF/gekodriver 

2. Current directory

Keep the gekodriver executable in the current directory where the Python script is being executed from.

3. Passed as executable_path

For example,

webdriver.Firefox(executable_path="c:\\gekodriver.exe") 
Sign up to request clarification or add additional context in comments.

Comments

0

The error is fixed, I just put the geckodriver.exe into the Python39 folder and it works now perfectly!

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.