python - 无法从节点连接 : A device attached to the system is not functioning error using ChromeDriver Selenium on Windows OS 读取描述符

标签 python selenium google-chrome windows-10 selenium-chromedriver

我在 python 中运行 selenium webdriver 脚本时得到了这个我还在系统环境中设置了路径,并尝试下载与我的 chrome 版本匹配的 webdriver。而且也是letest版本。但我仍然收到此错误:

[8552:6856:1120/155118.770:ERROR:device_event_log_impl.cc(211)] [15:51:18.771] USB: usb_device_handle_win.cc:1020 Failed to read descriptor from node connection: A device attached to the system is not functioning. (0x1F)
[8552:6856:1120/155118.774:ERROR:device_event_log_impl.cc(211)] [15:51:18.774] USB: usb_device_handle_win.cc:1020 Failed to read descriptor from node connection: A device attached to the system is not functioning. (0x1F)
[8552:6856:1120/155118.821:ERROR:device_event_log_impl.cc(211)] [15:51:18.821] USB: usb_device_handle_win.cc:1020 Failed to read descriptor from node connection: A device attached to the system is not functioning. (0x1F)
我在我的代码中使用了这个:
driver = webdriver.Chrome(resource_path("C:\\webdriver\\chromedriver.exe"))  # to open the chromebrowser
driver.get("https://web.whatsapp.com")

最佳答案

这是一个 chromedriver 问题,他们仍在解决问题。我不完全确定是什么原因造成的,但 Debanjan 的回答中似乎详细介绍了技术细节。
互联网上的一般解决方案似乎只是“忽略它”,但它确实使日志困惑很多。
不过,我确实找到了让它关闭的方法(以及经常弹出的“DevTools”警告)。

options = webdriver.ChromeOptions()
options.add_experimental_option('excludeSwitches', ['enable-logging'])
driver = webdriver.Chrome(options=options)
您还可以添加其他 chromedriver 选项并切换到该选项,此外还可以根据需要指向您的 chromedriver 可执行文件。

关于python - 无法从节点连接 : A device attached to the system is not functioning error using ChromeDriver Selenium on Windows OS 读取描述符,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64927909/

相关文章:

selenium - 在selenium grid上下载excel文件并读取它

selenium - 我需要通过 CSS 在 Selenium 中找到一个元素

javascript - Chrome 获取下载文件时会触发哪个 JS 事件?

ruby-on-rails - Rspec 和 Chrome/headless 标志

python - SimpleCV网络摄像头黑色图像

python - 根据一些键/值对从字典列表中合并字典

python - 训练后如何保存和加载我的神经网络模型以及 python 中的权重?

python - 非法指令 : 4 when running Django

java - Maven 使用关键字 "Test"运行所有测试

javascript - Chrome 扩展程序 : How to refresh a tab based on its title?