Headless_ie_driver启动Internet Explorer时发生意外错误IELaunchURL返回HRESULT 80070012“没有其他文件”

问题描述

您所看到的错误说明了一切:

selenium.common.exceptions.SessionNotCreatedException: Message: Unexpected error launching Internet Explorer. IELaunchURL() returned HRESULT 80070012 ('There are no more files.') for URL 'http://localhost:65393/'

如果您访问Release Page Release Notes 它明确提到了以下情况:

  • 支持Firefox和Chrome
  • 无头桌面不再启动Windows资源管理器。
  • 创建无头桌面后,desktop_utils.exe学会了不运行explorer.exe。

因此,无法使用 *


更新:

按您的评论Are there any alternatives to open IE and run it in background via selenium with mouse/keyboard inputsAnswer是 。

Github线程中的@JimEvans 明确提到:

他还补充说:

解决方法

我正在尝试运行一个简单的无头Web浏览器;

from selenium import webdriver
from selenium.webdriver.common.keys import Keys
driver = webdriver.Ie("headless_ie_selenium.exe")
driver.get("www.google.com")
print(driver.title)

我得到:

selenium.common.exceptions.SessionNotCreatedException: Message: Unexpected error launching Internet Explorer. IELaunchURL() returned HRESULT 80070012 ('There are no more files.') for URL 'http://localhost:65393/'

我试过但没用的东西:

1:

from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
caps = DesiredCapabilities.INTERNETEXPLORER.copy()
caps['ie.ensureCleanSession']= True
driver = webdriver.Ie("headless_ie_selenium.exe",capabilities=caps)

2:所有Internet选项安全设置处于同一级别,并且都选中了“启用保护模式”;

3:搜索要删除的C:\ Program文件夹,但是没有任何内容。

注意 :相同的代码对于普通的网络驱动程序(IEDriverServer.exe)可以正常工作,当我手动打开
headless_ie_selenium.exe时 ,它将启动:

Selenium driver found at: path..\IEDriverServer.exe
Started InternetExplorerDriver server (32-bit)
3.8.0.0

相关问答

依赖报错 idea导入项目后依赖报错,解决方案:https://blog....
错误1:代码生成器依赖和mybatis依赖冲突 启动项目时报错如下...
错误1:gradle项目控制台输出为乱码 # 解决方案:https://bl...
错误还原:在查询的过程中,传入的workType为0时,该条件不起...
报错如下,gcc版本太低 ^ server.c:5346:31: 错误:‘struct...