'python-selenium.common.exceptions.WebDriverException: Message: Unknown error

I'm up with python 3.8 and selenium but recently I downloaded the latest edge web driver zip file and runned the mswdedriver.exe from that and typed this code in my ide:

from selenium import webdriver

browser = webdriver.Edge('‪F:\za\python\Assistant\msedgedriver.exe')
browser.maximize_window()
browser.get(url='http://seleniumhq.org/')

but I see this error:

selenium.common.exceptions.WebDriverException: Message: 'MicrosoftEdgeDriver' executable needs to be 
in PATH. Please download from http://go.microsoft.com/fwlink/?LinkId=619687

Can you help me friends? Thanks in advance.



Solution 1:[1]

You need to give a path to the webdriver executable when you load a webdriver, or have it stored as an environment variable:

webdriver.Edge(executable_path="path/to/executable")

A web driver is essentially a special browser application, you must install that application before you can run anything with it.

Here's Edge's web driver download page. Or you can use the link from the error message http://go.microsoft.com/fwlink/?LinkId=619687

Here's a similar question Python Selenium Chrome Webdriver

Solution 2:[2]

The backslashes in the executable path need to be escaped, per Python syntax:

browser = webdriver.Edge('?F:\\za\\python\\Assistant\\msedgedriver.exe')

Solution 3:[3]

This problem appears to me you must put in "Bin Folder" the file "MicrosoftWebDriver.exe" as is , edit the previous name of edge webdriver to be "MicrosoftWebDriver.exe" and put it in the "Bin Folder"

Solution 4:[4]

  1. You need to download the browser driver from here
  2. After the download completes, extract the driver executable to your preferred location. Add the folder where the executable is located to your PATH environment variable.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 M Z
Solution 2 guest
Solution 3 Sherif Mohammad
Solution 4 Ameen Maheen