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

后端 未结 4 558
一向
一向 2020-12-10 16:47

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 chro

相关标签:
4条回答
  • 2020-12-10 17:11

    After a week of finding an answer to my error, I ended up with a solution that you just need to install pywin32 library and it will not gives you an error

    open cmd and type

    pip install pywin32

    and you are good to go.....!

    0 讨论(0)
  • 2020-12-10 17:11

    check your device list to see if there is any usb devices doesn't work. I solved this after My laptop have been enabled bluetooth and cam devices.

    0 讨论(0)
  • 2020-12-10 17:12

    This error message...

    [14432:11656:1120/161059.539:ERROR:device_event_log_impl.cc(211)] [16:10:59.539] 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. Chrome Browser session.


    Analysis

    This error occurs due to an USB device which is attached to the windows-10 system and 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. Chrome Browser session. So you can safely ignore the error.

    However in your code block you need to replace the keyword resource_path with executable_path and your effective code block will be:

    webdriver.Chrome(executable_path=r'C:\webdriver\chromedriver.exe') # to open the chromebrowser 
    driver.get("https://web.whatsapp.com")
    
    0 讨论(0)
  • 2020-12-10 17:15

    The error is probably because you have used parenthesis in the resource_path variable. The code should be as following:

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

    if still there is any problem you can try keeping the web driver in the same folder as the python file.

    0 讨论(0)
提交回复
热议问题