1

0.3 win 10 64 bit and am just writing my first selenium but its unsuccessful bcuz of this error here is my code

from time import sleep
from selenium import webdriver

browser = webdriver.Firefox()

browser.get('https://www.instagram.com/')

sleep(5)

browser.close()

and its is my wy way long error

Traceback (most recent call last):
  File "C:\Users\SuperUser_ROOT\Desktop\Projects\venv\lib\site-packages\selenium\webdriver\common\service.py", line 72, in start
    self.process = subprocess.Popen(cmd, env=self.env,
  File "C:\Users\SuperUser_ROOT\AppData\Local\Programs\Python\Python38\lib\subprocess.py", line 854, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "C:\Users\SuperUser_ROOT\AppData\Local\Programs\Python\Python38\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 "C:/Users/SuperUser_ROOT/Desktop/Projects/TRANSpy.py", line 4, in <module>
    browser = webdriver.Firefox()
  File "C:\Users\SuperUser_ROOT\Desktop\Projects\venv\lib\site-packages\selenium\webdriver\firefox\webdriver.py", line 164, in __init__
    self.service.start()
  File "C:\Users\SuperUser_ROOT\Desktop\Projects\venv\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.
Binannn
  • 11
  • 2

0 Answers0