1

I'm new to selenium library, please help me solve this error to start a firefox session using selenium.

This is my code so far

from selenium import webdriver
from selenium.webdriver.common.keys import Keys

# create a new Firefox session
driver = webdriver.Firefox()

and the error occurring is

Traceback (most recent call last): File "C:\Users\yash\AppData\Local\Programs\Python\Python36-32\lib\site-packages\selenium\webdriver\common\service.py", line 74, in start stdout=self.log_file, stderr=self.log_file) File "C:\Users\yash\AppData\Local\Programs\Python\Python36-32\lib\subprocess.py", line 707, in __init__restore_signals, start_new_session) File "C:\Users\yash\AppData\Local\Programs\Python\Python36-2\lib\subprocess.py", line 990, in _execute_child startupinfo) FileNotFoundError: [WinError 2] The system cannot find the file specified

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "A:\python\webscraping\seltry.py", line 5, in driver = webdriver.Firefox() File "C:\Users\yash\AppData\Local\Programs\Python\Python36-32\lib\site-packages\selenium\webdriver\firefox\webdriver.py", line 148, in init self.service.start() File "C:\Users\yash\AppData\Local\Programs\Python\Python36-32\lib\site-packages\selenium\webdriver\common\service.py", line 81, in start os.path.basename(self.path), self.start_error_message) selenium.common.exceptions.WebDriverException: Message: 'geckodriver' executable needs to be in PATH.

please help!

Yash Dagli
  • 45
  • 6
  • 3
    Possible duplicate of [Selenium using Python - Geckodriver executable needs to be in PATH](https://stackoverflow.com/questions/40208051/selenium-using-python-geckodriver-executable-needs-to-be-in-path) – JeffC Dec 31 '17 at 22:26
  • Possible duplicate of [selenium.common.exceptions.WebDriverException: Message: 'chromedriver' executable needs to be in PATH error with chrome](https://stackoverflow.com/questions/46085270/selenium-common-exceptions-webdriverexception-message-chromedriver-executabl) – undetected Selenium Jan 01 '18 at 13:54

1 Answers1

0

The error: selenium.common.exceptions.WebDriverException: Message: 'geckodriver' executable needs to be in PATH. pretty much explains this. You can follow this tutorial Selenium using Python - Geckodriver executable needs to be in PATH

And please research your question before asking as I think this could be considered a dublicate by some.

Mindaugas Bernatavičius
  • 3,757
  • 4
  • 31
  • 58
  • 1
    This IS a duplicate and should be marked as such instead of answering it so we don't end up with lots of dups and they will get cleaned up. – JeffC Dec 31 '17 at 22:26