Не работает модуль selenium python

Вот код:

from selenium import webdriver

driver = webdriver.Firefox()

Вот ошибка:

Traceback (most recent call last):
  File "C:\Users\Назар\AppData\Local\Programs\Python\Python38-32\lib\site-packages\selenium\webdriver\common\service.py", line 72, in start
    self.process = subprocess.Popen(cmd, env=self.env,
  File "C:\Users\Назар\AppData\Local\Programs\Python\Python38-32\lib\subprocess.py", line 854, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "C:\Users\Назар\AppData\Local\Programs\Python\Python38-32\lib\subprocess.py", line 1307, in _execute_child
    hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
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 "test2.py", line 3, in <module>
    driver = webdriver.Firefox()
  File "C:\Users\Назар\AppData\Local\Programs\Python\Python38-32\lib\site-packages\selenium\webdriver\firefox\webdriver.py", line 164, in __init__
    self.service.start()
  File "C:\Users\Назар\AppData\Local\Programs\Python\Python38-32\lib\site-packages\selenium\webdriver\common\service.py", line 81, in start
    raise WebDriverException(
selenium.common.exceptions.WebDriverException: Message: 'geckodriver' executable needs to be in PATH.

Ответы (1 шт):

Автор решения: AlexMTX

Нужно указать в аргументе executable_path путь до geckodriver.exe

from selenium import webdriver
driver = webdriver.Firefox(executable_path='твой/путь/к/geckodriver.exe')
driver.get('http://google.com')
→ Ссылка