简体   繁体   English

Selenium-Internet Explorer-Java-如何禁用图像加载?

[英]Selenium - Internet explorer - Java - How to disable images loading?

To improve the performance of the automation, trying to disable image loading. 为了提高自动化性能,请尝试禁用图像加载。

I found a way to do it in Firefox & Chrome (Ref: Selenium WebDriver/Firefox|Chrome/Java How to disable image loading ), not Internet Explorer . 我在Firefox和Chrome中找到了一种方法(参考Selenium WebDriver / Firefox | Chrome / Java如何禁用图像加载 ), 而不是Internet Explorer Please help me out here. 请帮我在这里。

Below is the answer, received from Selenium team. 以下是从硒团队获得的答案。

Ref: https://github.com/SeleniumHQ/selenium/issues/7512 参考: https : //github.com/SeleniumHQ/selenium/issues/7512

This isn't possible without changing the browser configuration/profile, and IE does not support profiles outside the currently logged in Windows user account. 在不更改浏览器配置/配置文件的情况下是不可能的,并且IE不支持当前登录的Windows用户帐户之外的配置文件。 The driver will not be modified to change the configuration, since there is no guaranteed way to revert the configuration change after the session ends. 由于无法保证在会话结束后还原配置更改,因此不会修改驱动程序以更改配置。 You can either manually set the browser configuration in the options dialog (if such a setting exists), manipulate the setting programmatically using the Windows registry (assuming such a setting exists for IE), or use a web proxy to block retrieval of images. 您可以在选项对话框中手动设置浏览器配置(如果存在这样的设置),可以使用Windows注册表以编程方式操作该设置(假设IE中存在这样的设置),也可以使用Web代理来阻止图像检索。 This is not a feature the driver will be implementing. 这不是驱动程序将要实现的功能。

To improve the performance of the automated program disableing the image loading within you need to modify the data for the name Display Inline Images within HKEY_CURRENT_USER\\Software\\Microsoft\\Internet Explorer\\Main through the Registry Editor as no as follows: 为了提高自动程序 去功能内的图像加载性能您需要修改 名称数据 Display Inline Images中的HKEY_CURRENT_USER\\Software\\Microsoft\\Internet Explorer\\Main通过注册表编辑器 ,因为没有如下:

Value name              Value data
---------------------   ----------
Display Inline Images   No

Snapshot: 快照:

IE_Display_inline_Images

To disable the images while browsing on Internet Explorer, you could open the Internet Options and go to the Advanced Ta b. 要在Internet Explorer上浏览时禁用图像,可以打开“ Internet选项”并转到“ 高级”表 Scroll down to Multimedia Section and uncheck Show Pictures check-box, click Apply and Exit. 向下滚动到“多媒体部分”,然后取消选中“ 显示图片”复选框,然后单击“ 应用并退出”。

在此处输入图片说明

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM