[英]Not able to open Internet Explorer 11 with Selenium Python bindings
I first started with the latest IEDriverSErver.exe v3.5.0 with enabled protected mode enabled for all the security zones and the registry FEATURE_BFCACHE subkey DWord value to 0. 我首先从最新的IEDriverSErver.exe v3.5.0开始,为所有安全区域启用了启用的保护模式,并且注册表FEATURE_BFCACHE子项DWord的值设置为0。
I would run the following code 我将运行以下代码
from selenium import webdriver
driver = webdriver.Ie()
from selenium import webdriver
driver = webdriver.Ie()
And get an Error 并得到一个错误
Message: Invalid capabilities in alwaysMatch: unknown capability named platform.
Next I tried to use IEDriverServer.exe v3.4.0 with the same settings and get the a different error, but the IE11 browser would open, but I can't control it due to error 接下来,我尝试使用具有相同设置的IEDriverServer.exe v3.4.0,并得到一个不同的错误,但是IE11浏览器将打开,但是由于错误我无法控制它
Message: Unexpected error launching Internet Explorer. IELaunchURL() returned HRESULT 80070005 ('Access is denied.') for URL 'http://localhost:56039/'
I am pretty new at python and having regained the fun with coding again. 我在python上还很陌生,并且再次获得了编码的乐趣。 I used to avoid programming in the past, but with a new outlook started to tackle python again and enjoying it. 过去我过去避免编程,但是有了新的面貌,它又开始解决python并开始使用它了。 Now for the question: 现在问题是:
I am trying to get python selenium module to open a Internet Explorer 11 browser but seem to having a bit of trouble. 我试图获取python selenium模块来打开Internet Explorer 11浏览器,但是似乎有点麻烦。
If anyone has any tip, tricks, help, or pointers, it would be greatly appreciated. 如果有人有任何技巧,窍门,帮助或指针,将不胜感激。
Thanks, 谢谢,
Learning Python Programmer Python 3.5.0 Selenium 3.5.0 Internet Explorer 11 Version 11.0.9600.1872CO IEDriver 3.5.0 and 3.4.0 学习Python程序员Python 3.5.0 Selenium 3.5.0 Internet Explorer 11版本11.0.9600.1872CO IEDriver 3.5.0和3.4.0
While working with Selenium 3.5.0
, IEDriverServer 3.5.0
and IE 11
you can consider to adapt to the configuration mentioned in this documentation and try the following code block: 在使用Selenium 3.5.0
, IEDriverServer 3.5.0
和IE 11
您可以考虑适应本文档中提到的配置,并尝试以下代码块:
from selenium import webdriver
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
capabilities = DesiredCapabilities.INTERNETEXPLORER
capabilities["platform"] = "WIN8"
capabilities["browserName"] = "internet explorer"
capabilities["ignoreProtectedModeSettings"] = True
capabilities["IntroduceInstabilityByIgnoringProtectedModeSettings"] = True
capabilities["nativeEvents"] = True
capabilities["ignoreZoomSetting"] = True
capabilities["requireWindowFocus"] = True
capabilities["INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS"] = True
browser = webdriver.Ie(capabilities=capabilities, executable_path="C:\\Utility\\BrowserDrivers\\IEDriverServer.exe")
browser.get("https://www.facebook.com/")
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.