When I try to execute this code :
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
driver= webdriver.Firefox("C:\Program Files\Mozilla Firefox")
driver.get("http://google.com")
I get the following error :
C:\Users\vipul\PycharmProjects\newproject\venv\Scripts\python.exe "C:/Users/vipul/PycharmProjects/newproject/Web Scraping.py"
Traceback (most recent call last):
  File "C:\Users\vipul\PycharmProjects\newproject\venv\lib\site-packages\selenium\webdriver\common\service.py", line 74, in start
    stdout=self.log_file, stderr=self.log_file)
  File "C:\Users\vipul\AppData\Local\Programs\Python\Python36-32\Lib\subprocess.py", line 709, in __init__
    restore_signals, start_new_session)
  File "C:\Users\vipul\AppData\Local\Programs\Python\Python36-32\Lib\subprocess.py", line 997, 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 "C:/Users/vipul/PycharmProjects/newproject/Web Scraping.py", line 4, in <module>
    driver= webdriver.Firefox("C:\Program Files\Mozilla Firefox")
  File "C:\Users\vipul\PycharmProjects\newproject\venv\lib\site-packages\selenium\webdriver\firefox\webdriver.py", line 148, in __init__
    self.service.start()
  File "C:\Users\vipul\PycharmProjects\newproject\venv\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. 
Process finished with exit code 1
 
     
     
     
    