• <bdo id='T4FYR'></bdo><ul id='T4FYR'></ul>
  • <tfoot id='T4FYR'></tfoot>
  • <legend id='T4FYR'><style id='T4FYR'><dir id='T4FYR'><q id='T4FYR'></q></dir></style></legend>

    <small id='T4FYR'></small><noframes id='T4FYR'>

      <i id='T4FYR'><tr id='T4FYR'><dt id='T4FYR'><q id='T4FYR'><span id='T4FYR'><b id='T4FYR'><form id='T4FYR'><ins id='T4FYR'></ins><ul id='T4FYR'></ul><sub id='T4FYR'></sub></form><legend id='T4FYR'></legend><bdo id='T4FYR'><pre id='T4FYR'><center id='T4FYR'></center></pre></bdo></b><th id='T4FYR'></th></span></q></dt></tr></i><div id='T4FYR'><tfoot id='T4FYR'></tfoot><dl id='T4FYR'><fieldset id='T4FYR'></fieldset></dl></div>

      1. 在 Selenium ChromeDriver 中禁用图像

        时间:2023-09-14

                <bdo id='s7Uns'></bdo><ul id='s7Uns'></ul>

                <small id='s7Uns'></small><noframes id='s7Uns'>

                  <legend id='s7Uns'><style id='s7Uns'><dir id='s7Uns'><q id='s7Uns'></q></dir></style></legend>
                1. <tfoot id='s7Uns'></tfoot>
                    <tbody id='s7Uns'></tbody>
                  <i id='s7Uns'><tr id='s7Uns'><dt id='s7Uns'><q id='s7Uns'><span id='s7Uns'><b id='s7Uns'><form id='s7Uns'><ins id='s7Uns'></ins><ul id='s7Uns'></ul><sub id='s7Uns'></sub></form><legend id='s7Uns'></legend><bdo id='s7Uns'><pre id='s7Uns'><center id='s7Uns'></center></pre></bdo></b><th id='s7Uns'></th></span></q></dt></tr></i><div id='s7Uns'><tfoot id='s7Uns'></tfoot><dl id='s7Uns'><fieldset id='s7Uns'></fieldset></dl></div>
                2. 本文介绍了在 Selenium ChromeDriver 中禁用图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  尝试禁用 ChromeDriver 中的图像加载.我正在使用以下代码,但它仍在加载图像.有什么建议吗?

                  Trying to disable images loading in ChromeDriver. I'm using the following code, however it's still loading the images. Any suggestions?

                  DesiredCapabilities capabilities = DesiredCapabilities.Chrome();
                  capabilities.SetCapability("chrome.switches", new string[1] { "disable-images" });
                  IWebDriver driver = new ChromeDriver(@"C:chromedriver", capabilities);
                  

                  推荐答案

                  我遇到了同样的问题,我找到了答案 这里;

                  I had the same problem and I found the answer here;

                  Map<String, Object> contentSettings = new HashMap<String, Object>();
                  contentSettings.put("images", 2);
                  
                  Map<String, Object> preferences = new HashMap<String, Object>();
                  preferences.put("profile.default_content_settings", contentSettings);
                  
                  DesiredCapabilities caps = DesiredCapabilities.chrome();
                  caps.setCapability("chrome.prefs", preferences);
                  

                  这篇关于在 Selenium ChromeDriver 中禁用图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:Selenium - 过时的元素参考:元素未附加到页面 下一篇:使用 selenium 保存页面中的图像

                  相关文章

                  <tfoot id='JK5D6'></tfoot>
                  <legend id='JK5D6'><style id='JK5D6'><dir id='JK5D6'><q id='JK5D6'></q></dir></style></legend>
                  • <bdo id='JK5D6'></bdo><ul id='JK5D6'></ul>

                    <small id='JK5D6'></small><noframes id='JK5D6'>

                      <i id='JK5D6'><tr id='JK5D6'><dt id='JK5D6'><q id='JK5D6'><span id='JK5D6'><b id='JK5D6'><form id='JK5D6'><ins id='JK5D6'></ins><ul id='JK5D6'></ul><sub id='JK5D6'></sub></form><legend id='JK5D6'></legend><bdo id='JK5D6'><pre id='JK5D6'><center id='JK5D6'></center></pre></bdo></b><th id='JK5D6'></th></span></q></dt></tr></i><div id='JK5D6'><tfoot id='JK5D6'></tfoot><dl id='JK5D6'><fieldset id='JK5D6'></fieldset></dl></div>