Closed StrangeDOS closed 4 years ago
browser = webdriver.Firefox(options = options, executable_path=r"PATH\TO\geckodriver.exe")
You have to put the path of geckodriver in the executable_path argument. You can download the driver from here: https://github.com/mozilla/geckodriver/releases. Let me see if I can use a drivermanager library to get rid of all this weird path stuff. Wait for the updates, until then you can try doing it manually as I have shown above.
The update did automatically download geckodriver.exe to the cache...which was cool. So this problem done. :)
Getting the following output when trying to run...
Traceback (most recent call last): File "C:\Users\\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\selenium\webdriver\common\service.py", line 72, in start
self.process = subprocess.Popen(cmd, env=self.env,
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.1520.0_x64qbz5n2kfra8p0\lib\subprocess.py", line 854, in init
self._execute_child(args, executable, preexec_fn, close_fds,
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.1520.0_x64qbz5n2kfra8p0\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 "comdown.py", line 68, in
browser = webdriver.Firefox(options = options, executable_path=r"PATH\TO\geckodriver.exe")
File "C:\Users\\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\selenium\webdriver\firefox\webdriver.py", line 164, in init
self.service.start()
File "C:\Users\\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\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.