pythonuser
pythonuser

Reputation: 11

Selenium code not executed after driver.get (browser is IE)

I am new to selenium. My code works fine with Chrome webdrive. However, when I switch to IE webdrive, my code does not execute after drive.get.

from selenium import webdriver
driver = webdriver.Ie(executable_path=r"C:\Drivers\IE_Driver\IEDriverServer.exe")
driver.get("https://www.amazon.com")
print(driver.current_url)
print ("Test")

Upvotes: 0

Views: 837

Answers (3)

towns
towns

Reputation: 1

I have tried set webdriver.IeOptions ignore_protected_mode_settings = True, then drive.get response.

Upvotes: 0

PDHide
PDHide

Reputation: 19929

https://github.com/SeleniumHQ/selenium/wiki/InternetExplorerDriver#required-configuration

you have to do the prerequisite steps mentioned there , expecially disabling the enhanced protection. I was able to reproduce your issue.

enter image description here

uncheck the box for everything internet,local , trustred and restricted

Upvotes: 0

SeleniumUser
SeleniumUser

Reputation: 4177

I have verified your code & its working without any issue.

from selenium import webdriver

driver = webdriver.Ie(executable_path=r"C:\IEDriverServer.exe")

driver.get("https://www.amazon.com")

print(driver.current_url)

print ("Test")

Output:

enter image description here

I would suggest to Download IE Drivers based on your OS (Windows 32 or 64 bit) and then try once again

Upvotes: 1

Related Questions