Hi I trying to run the below code for Edge Driver version Version 90.0.818.42 which is Chromium Based:
from selenium import webdriver
from msedge.selenium_tools import EdgeOptions
dirpath = os.getcwd()
edge_driver_path_used = dirpath + r'/features/resources/drivers/msedgedriver.exe'
my_edge_option = EdgeOptions()
my_edge_option.use_chromium = True
my_edge_option.binary_location = "C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe"
edge_driver = webdriver.Edge(options=my_edge_option)
edge_driver.get('My URL Here')
Upon running this code I am getting the below exception:
edge_driver = webdriver.Edge(options=my_edge_option)
TypeError: __init__() got an unexpected keyword argument 'options'
I don't seem to miss any import, then why am I getting this Exception? Kindly help me out
Seems like here's solution to your question: How to run Microsoft Edge headless with Selenium Python?
install the addition package like:
and initialize driver with:
Here's official docs: https://learn.microsoft.com/en-us/microsoft-edge/webdriver-chromium/?tabs=python