I am trying to open MS Edge in Internet Explorer mode using Selenium with the default user profile loaded.
The following opens Edge in Internet Explorer mode but the user profile is not the default profile.
from selenium import webdriver
import os
import sys
ieOptions = webdriver.IeOptions()
pwd = os.path.dirname(sys.argv[0])
web_driver_path = os.path.join(pwd,'IEDriverServer.exe')
msedge_user_profile = ('C:/Users/' + os.getlogin() + '/AppData/Local/Microsoft/Edge/User Data/')
ieOptions.add_additional_option('user-data-dir', msedge_user_profile)
ieOptions.add_additional_option("profile-directory", "Profile 1")
ieOptions.to_capabilities()
ieOptions.attach_to_edge_chrome = True
ieOptions.edge_executable_path = (
'C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe')
Any help would be really appreciated.