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

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

        <legend id='K55M4'><style id='K55M4'><dir id='K55M4'><q id='K55M4'></q></dir></style></legend>
        • <bdo id='K55M4'></bdo><ul id='K55M4'></ul>
      1. 如何在启动 Chrome 并尝试使用 Selenium 使用 Chrome

        时间:2023-10-08
          <bdo id='S5BUA'></bdo><ul id='S5BUA'></ul>
          <i id='S5BUA'><tr id='S5BUA'><dt id='S5BUA'><q id='S5BUA'><span id='S5BUA'><b id='S5BUA'><form id='S5BUA'><ins id='S5BUA'></ins><ul id='S5BUA'></ul><sub id='S5BUA'></sub></form><legend id='S5BUA'></legend><bdo id='S5BUA'><pre id='S5BUA'><center id='S5BUA'></center></pre></bdo></b><th id='S5BUA'></th></span></q></dt></tr></i><div id='S5BUA'><tfoot id='S5BUA'></tfoot><dl id='S5BUA'><fieldset id='S5BUA'></fieldset></dl></div>

              • <small id='S5BUA'></small><noframes id='S5BUA'>

                  <legend id='S5BUA'><style id='S5BUA'><dir id='S5BUA'><q id='S5BUA'></q></dir></style></legend>
                    <tbody id='S5BUA'></tbody>
                  <tfoot id='S5BUA'></tfoot>
                  本文介绍了如何在启动 Chrome 并尝试使用 Selenium 使用 ChromeDriver 访问网页时解决“获取默认适配器失败"错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我已经更新了 Selenium,但即使网页加载,错误仍然存​​在.然而,在某些情况下,驱动程序启动但它是停滞的.这会导致问题吗?如果是,我该如何解决?

                  I have updated Selenium but the error keeps occurring even though the web page loads. However, in some instances, the driver starts but it is stagnant. Is this causing an issue and if so, how do I resolve it?

                  [11556:9032:0502/152954.314:ERROR:device_event_log_impl.cc(162)] [15:29:54.314] Bluetooth: bluetooth_adapter_winrt.cc:1055 Getting Default Adapter failed.
                  

                  推荐答案

                  这个错误信息...

                  ERROR:device_event_log_impl.cc(162)] [15:29:54.314] Bluetooth: bluetooth_adapter_winrt.cc:1055 Getting Default Adapter failed.
                  

                  ...暗示 ScopedClosureRunner on_initBluetoothAdapterWinrt::OnGetDefaultAdapter() 中失败.

                  ...implies that ScopedClosureRunner on_init failed in BluetoothAdapterWinrt::OnGetDefaultAdapter().

                  此错误定义在 bluetooth_adapter_winrt.cc 如下:

                  This error is defined in bluetooth_adapter_winrt.cc as follows:

                  void BluetoothAdapterWinrt::OnGetDefaultAdapter(
                      base::ScopedClosureRunner on_init,
                      ComPtr<IBluetoothAdapter> adapter) {
                    DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
                    if (!adapter) {
                      BLUETOOTH_LOG(ERROR) << "Getting Default Adapter failed.";
                      return;
                    }
                  


                  解决方案

                  确保:

                  • Selenium 已升级到当前级别版本 3.141.59.
                  • ChromeDriver 已更新为当前 ChromeDriverv84.0 级别.
                  • Chrome 已更新至当前 Chrome 版本 84.0 级别.(根据 ChromeDriver v84.0 发行说明)
                  • 如果您的基本 Web 客户端 版本太旧,请卸载它并安装最新的 GA 和发布版本的 Web 客户端.
                  • Selenium is upgraded to current levels Version 3.141.59.
                  • ChromeDriver is updated to current ChromeDriver v84.0 level.
                  • Chrome is updated to current Chrome Version 84.0 level. (as per ChromeDriver v84.0 release notes)
                  • If your base Web Client version is too old, then uninstall it and install a recent GA and released version of Web Client.

                  但据观察,可以通过以 root 用户(administrator)身份运行 Chrome 来抑制此错误在 Linux 上.但这与 ChromeDriver 中的文档有偏差- 用于 Chrome 的 WebDriver 提到它的地方:

                  However it was observed that this error can be supressed by running Chrome as root user (administrator) on Linux. but that would be a deviation from the documentation in ChromeDriver - WebDriver for Chrome where it is mentioned:

                  Chrome 在启动期间崩溃的一个常见原因是在 Linux 上以 root 用户(管理员)身份运行 Chrome.虽然可以通过在创建 WebDriver 会话,即 ChromeDriver 会话,因为这种配置不受支持且强烈建议不要使用.

                  A common cause for Chrome to crash during startup is running Chrome as root user (administrator) on Linux. While it is possible to work around this issue by passing '--no-sandbox' flag when creating your WebDriver session, i.e. the ChromeDriver session as such a configuration is unsupported and highly discouraged.

                  理想情况下,您需要将环境配置为以普通用户身份运行 Chrome.

                  Ideally, you need to configure your environment to run Chrome as a regular user instead.

                  最后,根据 Selenium Chrome 驱动程序:解决有关注册表项和实验选项的错误消息可以通过添加参数来抑制这些错误日志:

                  Finally, as per the documentation in Selenium Chrome Driver: Resolve Error Messages Regarding Registry Keys and Experimental Options these error logs can be supressed by adding the argument:

                  excludeSwitches: ['enable-logging']
                  

                  所以你的有效代码块将是:

                  So your effective code block will be:

                  from selenium import webdriver
                  
                  options = webdriver.ChromeOptions() 
                  options.add_experimental_option("excludeSwitches", ["enable-logging"])
                  driver = webdriver.Chrome(options=options, executable_path=r'C:WebDriverschromedriver.exe')
                  driver.get("https://www.google.com/")
                  

                  这篇关于如何在启动 Chrome 并尝试使用 Selenium 使用 ChromeDriver 访问网页时解决“获取默认适配器失败"错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:如何使用 Selenium 和 Python 绑定禁用日志记录 下一篇:Selenium webdriver 在 chrome://downloads 找不到元素

                  相关文章

                  最新文章

                    • <bdo id='PpFbH'></bdo><ul id='PpFbH'></ul>
                    1. <legend id='PpFbH'><style id='PpFbH'><dir id='PpFbH'><q id='PpFbH'></q></dir></style></legend>
                      <i id='PpFbH'><tr id='PpFbH'><dt id='PpFbH'><q id='PpFbH'><span id='PpFbH'><b id='PpFbH'><form id='PpFbH'><ins id='PpFbH'></ins><ul id='PpFbH'></ul><sub id='PpFbH'></sub></form><legend id='PpFbH'></legend><bdo id='PpFbH'><pre id='PpFbH'><center id='PpFbH'></center></pre></bdo></b><th id='PpFbH'></th></span></q></dt></tr></i><div id='PpFbH'><tfoot id='PpFbH'></tfoot><dl id='PpFbH'><fieldset id='PpFbH'></fieldset></dl></div>
                    2. <tfoot id='PpFbH'></tfoot>

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