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!