Edge driver download fails due to outdated CDN (msedgedriver.azureedge.net)
Summary
The current implementation of webdriver-manager fails to download the Edge driver because it still tries to access the outdated CDN:
https://msedgedriver.azureedge.net/
This domain is no longer available. Microsoft has officially migrated to:
https://msedgedriver.microsoft.com/
Steps to Reproduce
- Use
EdgeChromiumDriverManager().install()in any script. - Run the script.
- The request to
azureedge.netfails with aConnectionError.
Environment
- OS: Windows 10 / 11
- webdriver-manager version: 4.0.2
- Edge version: 138.0.x.x
- Python version: 3.x
Expected Behavior
The manager should automatically use the new Microsoft CDN: https://msedgedriver.microsoft.com/
Suggested Fix
Update the internal references to point to the new domain, as recommended by Microsoft: https://learn.microsoft.com/en-us/microsoft-edge/webdriver-chromium/#download-and-install
Additional Notes
Microsoft support has confirmed this is expected behavior due to the CDN migration. Please update the download logic to reflect this change.
Thanks!
Same issue. Please update ASAP as this library has been used in serveral projects. Thank you and thank you again.
Same issue here.
Related links:
- https://github.com/SeleniumHQ/selenium/issues/16063
- https://github.com/webdriverio/selenium-standalone/issues/945
- https://github.com/webdriverio/selenium-standalone/pull/946
Stacktrace:
Traceback (most recent call last):
File "C:\python\Lib\site-packages\selenium\webdriver\common\driver_finder.py", line 38, in get_path
path = SeleniumManager().driver_location(options) if path is None else path
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\python\Lib\site-packages\selenium\webdriver\common\selenium_manager.py", line 94, in driver_location
output = self.run(args)
^^^^^^^^^^^^^^
File "C:\python\Lib\site-packages\selenium\webdriver\common\selenium_manager.py", line 140, in run
raise WebDriverException(f"Unsuccessful command executed: {command}.\n{result}{stderr}")
selenium.common.exceptions.WebDriverException: Message: Unsuccessful command executed: C:\python\Lib\site-packages\selenium\webdriver\common\windows\selenium-manager.exe --browser MicrosoftEdge --output json.
{'code': 65, 'message': 'error sending request for url (https://msedgedriver.azureedge.net/LATEST_RELEASE_138_WINDOWS): error trying to connect: dns error: No such host is known. (os error 11001)', 'driver_path': '', 'browser_path': ''}
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "test.py", line 69, in <module>
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\python\Lib\site-packages\selenium\webdriver\common\driver_finder.py", line 38, in get_path
path = SeleniumManager().driver_location(options) if path is None else path
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\python\Lib\site-packages\selenium\webdriver\common\selenium_manager.py", line 94, in driver_location
output = self.run(args)
^^^^^^^^^^^^^^
File "C:\python\Lib\site-packages\selenium\webdriver\common\selenium_manager.py", line 140, in run
raise WebDriverException(f"Unsuccessful command executed: {command}.\n{result}{stderr}")
selenium.common.exceptions.WebDriverException: Message: Unsuccessful command executed: C:\python\Lib\site-packages\selenium\webdriver\common\windows\selenium-manager.exe --browser MicrosoftEdge --output json.
{'code': 65, 'message': 'error sending request for url (https://msedgedriver.azureedge.net/LATEST_RELEASE_138_WINDOWS): error trying to connect: dns error: No such host is known. (os error 11001)', 'driver_path': '', 'browser_path': ''}
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "test.py", line 69, in <module>
File "C:\python\Lib\site-packages\selenium\webdriver\common\selenium_manager.py", line 94, in driver_location
output = self.run(args)
^^^^^^^^^^^^^^
File "C:\python\Lib\site-packages\selenium\webdriver\common\selenium_manager.py", line 140, in run
raise WebDriverException(f"Unsuccessful command executed: {command}.\n{result}{stderr}")
selenium.common.exceptions.WebDriverException: Message: Unsuccessful command executed: C:\python\Lib\site-packages\selenium\webdriver\common\windows\selenium-manager.exe --browser MicrosoftEdge --output json.
{'code': 65, 'message': 'error sending request for url (https://msedgedriver.azureedge.net/LATEST_RELEASE_138_WINDOWS): error trying to connect: dns error: No such host is known. (os error 11001)', 'driver_path': '', 'browser_path': ''}
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "test.py", line 69, in <module>
selenium.common.exceptions.WebDriverException: Message: Unsuccessful command executed: C:\python\Lib\site-packages\selenium\webdriver\common\windows\selenium-manager.exe --browser MicrosoftEdge --output json.
{'code': 65, 'message': 'error sending request for url (https://msedgedriver.azureedge.net/LATEST_RELEASE_138_WINDOWS): error trying to connect: dns error: No such host is known. (os error 11001)', 'driver_path': '', 'browser_path': ''}
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "test.py", line 69, in <module>
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "test.py", line 69, in <module>
Traceback (most recent call last):
File "test.py", line 69, in <module>
Traceback (most recent call last):
File "test.py", line 69, in <module>
File "test.py", line 69, in <module>
driver = my_webdriver.create_webdriver(download_directory)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "my_webdriver.py", line 26, in create_webdriver
driver = webdriver.Edge(options = options)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\python\Lib\site-packages\selenium\webdriver\edge\webdriver.py", line 45, in __init__
super().__init__(
File "C:\python\Lib\site-packages\selenium\webdriver\chromium\webdriver.py", line 51, in __init__
self.service.path = DriverFinder.get_path(self.service, options)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\python\Lib\site-packages\selenium\webdriver\common\driver_finder.py", line 41, in get_path
raise NoSuchDriverException(msg) from err
selenium.common.exceptions.NoSuchDriverException: Message: Unable to obtain driver for MicrosoftEdge using Selenium Manager.; For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors/driver_location
Please fix asap.
Workaround:
# WORKAROUND
class CustomHttpClient(HttpClient):
def get(self, url, params=None, **kwargs) -> Response:
"""
Add you own logic here like session or proxy etc.
"""
# WORKAROUND: https://msedgedriver.azureedge.net/LATEST_RELEASE_138_WINDOWS is now at https://msedgedriver.microsoft.com/LATEST_RELEASE_138_WINDOWS ; so replace azureedge.net with microsoft.com
original_url = url
url = original_url.replace("azureedge.net", "microsoft.com")
log(f"my_webdriver CustomHttpClient: GET request to {url} (original: {original_url}) with params {params}")
return requests.get(url, params, **kwargs)
driver = webdriver.Edge(
# service=EdgeService(EdgeChromiumDriverManager().install()), options = options # without WORKAROUND
service=EdgeService(EdgeChromiumDriverManager(download_manager=WDMDownloadManager(CustomHttpClient())).install()), options = options
)
A temporarily way to solve it in Python is as below:
driverPath = EdgeChromiumDriverManager( url="https://msedgedriver.microsoft.com/", latest_release_url="https://msedgedriver.microsoft.com/LATEST_RELEASE" ).install()
Why has it not been fixed yet?
When can we expect this issue to be fixed?
When can we expect this issue to be fixed?
Updating selenium server jar to 4.35 fixed my issue .Thanks