     [Answers](https://scrapfly.io/blog)   /  [python](https://scrapfly.io/blog/tag/python)   /  [Selenium: geckodriver executable needs to be in PATH?](https://scrapfly.io/blog/answers/selenium-geckodriver-in-path)   # Selenium: geckodriver executable needs to be in PATH?

 by [Bernardas Alisauskas](https://scrapfly.io/blog/author/bernardas) Dec 19, 2022 1 min read [\#python](https://scrapfly.io/blog/tag/python) [\#selenium](https://scrapfly.io/blog/tag/selenium) 

 [  ](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fscrapfly.io%2Fblog%2Fanswers%2Fselenium-geckodriver-in-path "Share on LinkedIn")    

 

 

Selenium is a popular web browser automation library used for web scraping. To run, however, Selenium needs special web browser executables called drivers. For example, to run Firefox web browser Selenium needs [geckodriver](https://github.com/mozilla/geckodriver/releases) to be installed. Without it a generic exception will be raised:

text```text
selenium.common.exceptions.WebDriverException: Message: 'geckodriver' executable needs to be in PATH.
```



This can also mean that the geckodriver is installed but Selenium can't find it. To fix this the geckodriver location should be added to the `PATH` environment variable:

shell```shell
$ export PATH=$PATH:/location/where/geckodriver/is/
```



Alternatively, we can specify the driver directly in the Selenium initiation code:

python```python
from selenium import webdriver
driver = webdriver.Firefox(executable_path=r'your\path\geckodriver.exe')
driver.get('https://scrapfly.io/')
```





 

    



Scale Your Web Scraping

Anti-bot bypass, browser rendering, and rotating proxies, all in one API. Start with 1,000 free credits.

  No credit card required  1,000 free API credits  Anti-bot bypass included 

 [Start Free](https://scrapfly.io/register) [View Docs](https://scrapfly.io/docs/onboarding) 

 Not ready? Get our newsletter instead. 

 

## Explore this Article with AI

 [ ChatGPT ](https://chat.openai.com/?q=Summarize%20this%20page%3A%20https%3A%2F%2Fscrapfly.io%2Fblog%2Fanswers%2Fselenium-geckodriver-in-path) [ Gemini ](https://www.google.com/search?udm=50&aep=11&q=Summarize%20this%20page%3A%20https%3A%2F%2Fscrapfly.io%2Fblog%2Fanswers%2Fselenium-geckodriver-in-path) [ Grok ](https://x.com/i/grok?text=Summarize%20this%20page%3A%20https%3A%2F%2Fscrapfly.io%2Fblog%2Fanswers%2Fselenium-geckodriver-in-path) [ Perplexity ](https://www.perplexity.ai/search/new?q=Summarize%20this%20page%3A%20https%3A%2F%2Fscrapfly.io%2Fblog%2Fanswers%2Fselenium-geckodriver-in-path) [ Claude ](https://claude.ai/new?q=Summarize%20this%20page%3A%20https%3A%2F%2Fscrapfly.io%2Fblog%2Fanswers%2Fselenium-geckodriver-in-path) 



 ## Related Articles

 [  

 http 

### What is HTTP 406 Error? (Not Acceptable)

HTTP status code 406 generally means wrong Accept- header family configuration. Here's how to prevent it.

 

 ](https://scrapfly.io/blog/posts/what-is-http-error-406-not-acceptable) [  

 http 

### What is HTTP 401 Error and How to Fix it

Discover the HTTP 401 error meaning, its causes, and solutions in this comprehensive guide. Learn how 401 unauthorized e...

 

 ](https://scrapfly.io/blog/posts/what-is-http-401-error-and-how-to-fix-it) [     

### What is HTTP 405 Error? (Method Not Allowed)

HTTP error codes can be confusing, especially when they disrupt your web scraping or automation tasks. One such error is...

 

 ](https://scrapfly.io/blog/posts/what-is-http-405-error) 

  ## Related Questions

- [ Q Selenium: chromedriver executable needs to be in PATH? ](https://scrapfly.io/blog/answers/selenium-chromedriver-in-path)
- [ Q How to save and load cookies in Selenium? ](https://scrapfly.io/blog/answers/how-to-save-and-load-cookies-in-selenium)
- [ Q How to get page source in Selenium? ](https://scrapfly.io/blog/answers/how-to-get-page-source-in-selenium)
- [ Q How to find elements by XPath in Selenium ](https://scrapfly.io/blog/answers/how-to-find-elements-by-xpath-in-selenium)
 
  



   



 Run headless browsers at scale, **1,000 free credits** [Start Free](https://scrapfly.io/register)