I am a beginner to Selenium python. I have tried to invoke the Edge browser with an existing profile(Default) with the following code. But it is throwing the following exception as soon as the execution starts. Can someone please help me with this? Am I missing something?
edge_options = webdriver.EdgeOptions()
edge_options.add_argument("user-data-dir = C:/Users/XYZ/AppData/Local/Microsoft/Edge/User Data/Default")
edge_browser = webdriver.Edge(executable_path = "C:/Users/XYZ/ABC/msedgedriver.exe",options = edge_options )
edge_browser.maximize_window()
WebDriverException: unknown error: MSEdge failed to start: crashed. (chrome not reachable) (The process started from msedge location C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe is no longer running, so MSEdgeDriver is assuming that MSEdge has crashed.)
Note: Edge browser is getting invoked and works properly when I run the code without the following line
edge_options.add_argument("user-data-dir = C:/Users/XYZ/AppData/Local/Microsoft/Edge/User Data/Default")