开发手册 欢迎您!
软件开发者资料库

Python 使用selenium webdriver报错:Failed to read descriptor from node connection解决方法

本文主要介绍Python中,使用Selenium Webdriver(ChromeDriver)运行时报错:[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)的解决方法。

调用时出错代码:

driver = webdriver.Chrome(resource_path("C:\\webdriver\\chromedriver.exe")) # to open the chromebrowserdriver.get("https://www.example.com")

解决方法

查找相关文档,将resource_path替换成executable_path即可解决,代码如下:

webdriver.Chrome(executable_path=r'C:\webdriver\chromedriver.exe') # to open the chromebrowserdriver.get("https://web.whatsapp.com")

相关文档

USB: usb_device_handle_win.cc:1020 Failed to read descriptor from node connection error with ChromeDriver v87 / Chrome v87 using Selenium on Windows10

Failed to read descriptor from node connection: A device attached to the system is not functioning error using ChromeDriver Chrome through Selenium