Welcome to WuJiGu Developer Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.3k views
in Technique[技术] by (71.8m points)

python - Failed to read descriptor from node connection: A device attached to the system is not functioning error using ChromeDriver Selenium on Windows OS

I got this while running the selenium webdriver script in python I also set the path in System Environment and also tried downloading the webdriver that matches with my chrome version. And also letest version also. But I still get this error:

[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)

I used this in my code :

driver = webdriver.Chrome(resource_path("C:\webdriver\chromedriver.exe"))  # to open the chromebrowser
driver.get("https://web.whatsapp.com")
Question&Answers:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

This is a chromedriver issue that they're still working the kinks out of. I'm not entirely sure what's causing it, but the technical details seem to be detailed in Debanjan's answer.

The general solution on the internet just seems to be "ignore it", but it sure clutters up the logs a lot.

I did find a way to get it to shut up though (as well as the "DevTools" warning that pops up a lot as well).

options = webdriver.ChromeOptions()
options.add_experimental_option('excludeSwitches', ['enable-logging'])
driver = webdriver.Chrome(options=options)

You can add your other chromedriver options and switches onto that as well, in addition to pointing to your chromedriver executable if you wish.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to WuJiGu Developer Q&A Community for programmer and developer-Open, Learning and Share
...