Home > Software engineering >  Python Selenium Internet Explorer scripts don't work
Python Selenium Internet Explorer scripts don't work

Time:11-18

If I make a simple script like this:

from selenium import webdriver
from selenium.webdriver.ie.service import Service
import os
from pathlib import Path

path = Path().absolute()
path = os.path.join(path, 'IEDriverServer')
driver = webdriver.Ie(executable_path=path)
driver.get('https://www.google.com/')
print("ANYTHINGGG")

Selenium opens the Edge on IE mode (no problem), opens google, but after that it stops... don't print "ANYTHINGGG" and I cannot program anything after driver.get('https://www.google.com/').

This problem seems to be in any site.

Anyone has a clue of what can solve that?

(I am using windows 10, python 3.7.9)

Just expect that the code do not stops on driver.get('https://www.google.com/')

CodePudding user response:

If you want to automate Edge IE mode with IEDriver, you need to:

  1. Define InternetExplorerOptions with additional properties that point to the Microsoft Edge browser.
  2. Start an instance of InternetExplorerDriver and pass it InternetExplorerOptions. IEDriver launches Microsoft Edge and then loads your web content in IE mode.

You also need to meet the enter image description here

CodePudding user response:

It's working now, after meet the Required Configuration, specifically after creating the registries entries on windows, thank you Yu Zhou

  • Related