Welcome to OGeek 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 Chrome through Selenium

from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
import time
import pyautogui
import requests
import nltk   
import urllib.request
import random



driver=webdriver.Chrome()
driver.get('https://www.karsanj.net/login.php')
userm=driver.find_element_by_id('username')
userm.send_keys('gdbcfss')
time.sleep(2)
passwoord=driver.find_element_by_id('password')
passwoord.send_keys('fbxeedf')
time.sleep(2)
sal =driver.find_element_by_id("salTahsili")
sal.click()
time.sleep(2)
pyautogui.press('down')
time.sleep(2)
pyautogui.press('enter')
time.sleep(2)
login=driver.find_element_by_name('login')
login.click()
time.sleep(10)
driver.get('https://www.karsanj.net/vschool_list.php')

def goonline():
    urlsite=driver.current_url()
        
def urlgetter(driver):
    time.sleep(7)
    try:
        onlineclass=driver.find_element_by_class_name('entrance-btn')
        onlineclass.click()
    except:
        print('no online classes in this time ')
    time.sleep(5)
    classon=driver.find_element_by_id('room_unique_url')
    classon.click()
    time.sleep(20)
    attend= driver.find_elements_by_class_name('tablet-beta-label')
    pyautogui.press('enter')
    time.sleep(15)
    try:
        pyautogui.click()
        close1=driver.find_elements_by_id('recording-locked-notifier_0')
        close1.click()
        close2=driver.find_elements_by_class_name('spectrum-Button spectrum-Button--secondary')
        close2.click()
    except:
        pass




urlgetter(driver)

When i run it give me this error at the end

DevTools listening on ws://127.0.0.1:60683/devtools/browser/9b15c32e-ddc1-4ddd-9abe-bcf597ad4821
[4888:9376:1120/223739.924:ERROR:device_event_log_impl.cc(211)] [22:37:39.924] USB: usb_device_handle_win.cc:1020 Failed to read descriptor from node connection: A device attached to the system is not functioning. (0x1F)
See Question&Answers more detail:os

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

1 Reply

0 votes
by (71.8m points)

This error message...

DevTools listening on ws://127.0.0.1:60683/devtools/browser/9b15c32e-ddc1-4ddd-9abe-bcf597ad4821
[4888:9376:1120/223739.924:ERROR:device_event_log_impl.cc(211)] 
[22:37:39.924] USB: usb_device_handle_win.cc:1020 Failed to read descriptor from node connection: A device attached to the system is not functioning. (0x1F)

...implies that the ChromeDriver raised an error while in trying to initiate/spawn a new Browsing Context i.e. session.


Analysis

This error surfaces on systems due to an error in callback of an attached USB device which isn't functioning properly.

This error is defined within usb_device_handle_win.cc as follows:

void UsbDeviceHandleWin::GotDescriptorFromNodeConnection(
    TransferCallback callback,
    scoped_refptr<base::RefCountedBytes> request_buffer,
    scoped_refptr<base::RefCountedBytes> original_buffer,
    Request* request_ptr,
    DWORD win32_result,
    size_t bytes_transferred) {
  std::unique_ptr<Request> request = UnlinkRequest(request_ptr);
  if (win32_result != ERROR_SUCCESS) {
    SetLastError(win32_result);
    USB_PLOG(ERROR) << "Failed to read descriptor from node connection";
    std::move(callback).Run(UsbTransferStatus::TRANSFER_ERROR, nullptr, 0);
    return;
  }

Solution

This error isn't harmful and doesn't blocks the spawning of the new Browsing Context i.e. the Chrome Browser session. So you can safely ignore the error.


References

You can find a couple of relevant detailed discussions in:


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...