【问题标题】:Failed to read descriptor from node connection: A device attached to the system is not functioning error using ChromeDriver Chrome through Selenium无法从节点连接读取描述符:连接到系统的设备无法使用 ChromeDriver Chrome 通过 Selenium 运行错误
【发布时间】:2020-11-21 06:45:59
【问题描述】:
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)

当我运行它时,最后给我这个错误

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)

【问题讨论】:

    标签: python selenium google-chrome selenium-webdriver selenium-chromedriver


    【解决方案1】:

    此错误消息...

    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)
    

    ...暗示ChromeDriver 在尝试启动/生成新的浏览上下文时引发错误,即 会话。


    分析

    此错误出现在 系统上,原因是连接的 USB 设备的回调错误,该设备无法正常工作。

    此错误在usb_device_handle_win.cc 中定义如下:

    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;
      }
    

    解决方案

    此错误无害,也不会阻止生成新的浏览上下文Chrome 浏览器 会话。因此,您可以放心地忽略该错误。


    参考文献

    您可以在以下位置找到一些相关的详细讨论:

    【讨论】:

      猜你喜欢
      • 2021-03-03
      • 1970-01-01
      • 2022-10-03
      • 2021-03-12
      • 1970-01-01
      • 2015-03-14
      相关资源
      最近更新 更多