简体   繁体   English

无法使用Selenium Python绑定打开Internet Explorer 11

[英]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.0IEDriverServer 3.5.0IE 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/")

Possible workaround for the unknown capability named platform issue can be found here . 此处可以找到针对unknown capability named platform问题)的可能解决方法。

Basically you delete platform and version keys from the capabilities . 基本上,您从capabilities删除platformversion密钥。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无法通过Selenium WebDriver python绑定启动Internet Explorer - Unable to launch Internet Explorer through Selenium WebDriver python bindings 使用 Python 和 Selenium 在 Internet Explorer 11 中自动下载文件 - Download files automatically in Internet Explorer 11 with Python and Selenium Python Selenium Internet explorer 找不到 css 选择器,或 Z3D788FA62D7C74105A1BEE4C91 - Python Selenium Internet explorer not able to find css selector, or xpath Selenium 在 Inte.net Explorer 中用 Python 测试 - Selenium test with Python in Internet Explorer 使用 Selenium Python 在私有模式下打开 Internet Explorer - Opening Internet Explorer in Private Mode with Selenium Python Python Selenium Inte.net Explorer 模式下的 Edge 浏览器 - Python Selenium Edge Browser in Internet Explorer mode 如何使用 python 和 selenium 在 Internet Explorer(IE)模式下打开 Microsoft Edge? - How to open Microsoft Edge in Internet Explorer(IE) Mode using python and selenium? 带有python绑定的Selenium会启动Firefox,但不会启动Explorer和Chrome浏览器 - Selenium with python bindings launches Firefox but not Explorer and Chrome browsers 硒+ Python + Internet Explorer +公司代理+ PAC文件+凭据 - Selenium + Python + Internet Explorer + Firm Proxy + PAC file + Credentials Python Selenium Inte.net Explorer 脚本不工作 - Python Selenium Internet Explorer scripts don't work
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM