Edit: this was solved by @ethankrein thanks!!
I get this error after running udemy_automate_course_enroll_v1.py , driver is in the system path I have already checked as per the instructions given here, Edge driver and browser match, I have already restarted. (https://www.selenium.dev/documentation/en/selenium_installation/installing_webdriver_binaries/). Please help!
This is how modified lines are set:
path = "C:\Webdriver\bin\msedgedriver.exe"
driver = webdriver.Edge(path)
This is the result:
"C:\Webdriver\bin\udemy_automate_course_enroll_v1.py"
Traceback (most recent call last):
File "C:\Users\Usuario\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\Usuario\AppData\Local\Programs\Python\Python38\lib\subprocess.py", line 854, in init
self._execute_child(args, executable, preexec_fn, close_fds,
File "C:\Users\Usuario\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
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Webdriver\bin\udemy_automate_course_enroll_v1.py", line 53, in
driver = webdriver.Edge(path) # webdriver.Chrome(path) for Google Chrome, webdriver.Firefox(path) for Mozilla Firefox, webdriver.Edge(path) for Microsoft Edge, webdriver.Safari(path) for Apple Safari
File "C:\Users\Usuario\AppData\Local\Programs\Python\Python38\lib\site-packages\selenium\webdriver\edge\webdriver.py", line 56, in init
self.edge_service.start()
File "C:\Users\Usuario\AppData\Local\Programs\Python\Python38\lib\site-packages\selenium\webdriver\common\service.py", line 81, in start
raise WebDriverException(
selenium.common.exceptions.WebDriverException: Message: 'msedgedriver' executable needs to be in PATH. Please download from http://go.microsoft.com/fwlink/?LinkId=619687
Fixed this for edge and firefox, using a different Line 54 however now I get this:
Unable to enroll for this course either because you have already claimed it or the browser window has been closed
Unable to enroll for this course either because you have already claimed it or the browser window has been closed
Unable to enroll for this course either because you have already claimed it or the browser window has been closed
Unable to enroll for this course either because you have already claimed it or the browser window has been closed
Unable to enroll for this course either because you have already claimed it or the browser window has been closed
Unable to enroll for this course either because you have already claimed it or the browser window has been closed