Using Selenium’s new webdriver feature

I’ve used Selenium for years but it looks like they’ve changed how you use it and I’m getting nothing but errors. Here’s what I have tried:

from selenium import webdriver
driver = webdriver.Edge('Downloads/msedgedriver.exe')
driver.get('https://www.google.com')

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
~AppDataRoamingPythonPython37site-packagesseleniumwebdrivercommondriver_finder.py in get_path(service, options)
     37         try:
---> 38             path = SeleniumManager().driver_location(options) if path is None else path
     39         except Exception as err:

~AppDataRoamingPythonPython37site-packagesseleniumwebdrivercommonselenium_manager.py in driver_location(self, options)
     70 
---> 71         browser = options.capabilities["browserName"]
     72 

AttributeError: 'str' object has no attribute 'capabilities'

During handling of the above exception, another exception occurred:

AttributeError                            Traceback (most recent call last)
<ipython-input-16-957b8ee50b85> in <module>
      1 from selenium import webdriver
      2 # driver = webdriver.Edge()
----> 3 driver = webdriver.Edge('Downloads/msedgedriver.exe')
      4 driver.get('https://www.google.com')

~AppDataRoamingPythonPython37site-packagesseleniumwebdriveredgewebdriver.py in __init__(self, options, service, keep_alive)
     48             options,
     49             service,
---> 50             keep_alive,
     51         )

~AppDataRoamingPythonPython37site-packagesseleniumwebdriverchromiumwebdriver.py in __init__(self, browser_name, vendor_prefix, options, service, keep_alive)
     49         self.service = service
     50 
---> 51         self.service.path = DriverFinder.get_path(self.service, options)
     52 
     53         self.service.start()

~AppDataRoamingPythonPython37site-packagesseleniumwebdrivercommondriver_finder.py in get_path(service, options)
     38             path = SeleniumManager().driver_location(options) if path is None else path
     39         except Exception as err:
---> 40             msg = f"Unable to obtain driver for {options.capabilities['browserName']} using Selenium Manager."
     41             raise NoSuchDriverException(msg) from err
     42 

AttributeError: 'str' object has no attribute 'capabilities'
from selenium import webdriver
driver = webdriver.Edge()
driver.get('https://www.google.com')

---------------------------------------------------------------------------
WebDriverException                        Traceback (most recent call last)
~AppDataRoamingPythonPython37site-packagesseleniumwebdrivercommondriver_finder.py in get_path(service, options)
     37         try:
---> 38             path = SeleniumManager().driver_location(options) if path is None else path
     39         except Exception as err:

~AppDataRoamingPythonPython37site-packagesseleniumwebdrivercommonselenium_manager.py in driver_location(self, options)
     89 
---> 90         output = self.run(args)
     91 

~AppDataRoamingPythonPython37site-packagesseleniumwebdrivercommonselenium_manager.py in run(args)
    137         if completed_proc.returncode:
--> 138             raise WebDriverException(f"Unsuccessful command executed: {command}.n{result}{stderr}")
    139         return result

WebDriverException: Message: Unsuccessful command executed: C:UsersuserAppDataRoamingPythonPython37site-packagesseleniumwebdrivercommonwindowsselenium-manager.exe --browser MicrosoftEdge --output json.
{'code': 65, 'message': 'error sending request for url (https://msedgedriver.azureedge.net/LATEST_RELEASE_127_WINDOWS): error trying to connect: An existing connection was forcibly closed by the remote host. (os error 10054)', 'driver_path': '', 'browser_path': ''}


The above exception was the direct cause of the following exception:

NoSuchDriverException                     Traceback (most recent call last)
<ipython-input-17-09613be0d9cb> in <module>
      1 from selenium import webdriver
----> 2 driver = webdriver.Edge()
      3 # driver = webdriver.Edge('Downloads/msedgedriver.exe')
      4 driver.get('https://www.google.com')

~AppDataRoamingPythonPython37site-packagesseleniumwebdriveredgewebdriver.py in __init__(self, options, service, keep_alive)
     48             options,
     49             service,
---> 50             keep_alive,
     51         )

~AppDataRoamingPythonPython37site-packagesseleniumwebdriverchromiumwebdriver.py in __init__(self, browser_name, vendor_prefix, options, service, keep_alive)
     49         self.service = service
     50 
---> 51         self.service.path = DriverFinder.get_path(self.service, options)
     52 
     53         self.service.start()

~AppDataRoamingPythonPython37site-packagesseleniumwebdrivercommondriver_finder.py in get_path(service, options)
     39         except Exception as err:
     40             msg = f"Unable to obtain driver for {options.capabilities['browserName']} using Selenium Manager."
---> 41             raise NoSuchDriverException(msg) from err
     42 
     43         if path is None or not Path(path).is_file():

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

I’ve tried different tips but want to avoid downloading itself as this is for work and any sort of download requires IT intervention, which is always a roadblock. Any help would be appreciated.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật