I have a webpage in which popup only opens in internet explorer and not in other browsers including chrome, fire fox and edge. The only solution that I have to extract data from such pop up in headless mode is to load the page in edge in internet explorer mode. However I am not able to switch to internet explorer mode in edge using python. Is there any way this can be done? Image showing the settings that needed to be changed:
From the description, I understand that you want to launch the Edge browser with IE mode using Selenium Python code.
At present, we can only launch the Edge browser with IE mode using Selenium C# code.
If you are available to use selenium with C# language then you can refer to the steps below.
static void Main(string[] args)
{
var dir = "{FULL_PATH_TO_IEDRIVERSERVER}";
var driver = "IEDriverServer.exe";
if (!Directory.Exists(dir) || !File.Exists(Path.Combine(dir, driver)))
{
Console.WriteLine("Failed to find {0} in {1} folder.", dir, driver);
return;
}
var ieService = InternetExplorerDriverService.CreateDefaultService(dir, driver);
var ieOptions = new InternetExplorerOptions{};
ieOptions.AddAdditionalCapability("ie.edgechromium", true);
ieOptions.AddAdditionalCapability("ie.edgepath", "{FULL_PATH_TO_MSEDGE.EXE}");
var webdriver = new InternetExplorerDriver(ieService, ieOptions, TimeSpan.FromSeconds(30));
webdriver.Url = "http://Your_Site_URL_here...";
}
Notes:
For example: ieOptions.AddAdditionalCapability("ie.edgepath", @"C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe");
.
Helpful references:
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.