I've looked at several other forum posts and found similar problems, but after trying all the solutions none of them have worked thus far. Here is my code (taken directly from a tutorial I've been following):
from time import sleep
from selenium import webdriver
driver = webdriver.Firefox(executable_path='/opt/geckoDriver/geckodriver.exe')
driver.get('https://instagram.com/')
sleep(5)
driver.close()
And here is the error it's spitting out:
Traceback (most recent call last):
File "C:\Users\14053\AppData\Local\Programs\Python\Python38\lib\site-packages\selenium\webdriver\common\service.py", line 72, in start
self.process = subprocess.Popen(cmd, env=self.env,
File "C:\Users\14053\AppData\Local\Programs\Python\Python38\lib\subprocess.py", line 854, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "C:\Users\14053\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 "D:\Documents\Python\Instagram bot 0.py", line 5, in <module>
driver = webdriver.Firefox(executable_path='/opt/geckoDriver/geckodriver.exe')
File "C:\Users\14053\AppData\Local\Programs\Python\Python38\lib\site-packages\selenium\webdriver\firefox\webdriver.py", line 164, in __init__
self.service.start()
File "C:\Users\14053\AppData\Local\Programs\Python\Python38\lib\site-packages\selenium\webdriver\common\service.py", line 81, in start
raise WebDriverException(
selenium.common.exceptions.WebDriverException: Message: 'geckodriver.exe' executable needs to be in PATH.
I've downloaded the geckodriver executable but it's just in my downloads folder because I have no clue where to put it for the code to access it. I've tried a few places but haven't had much luck.
(I'm somewhat new to programming/indexing in general, so explain it to me like I'm a student who has no clue)