2

I used Selenium to display the website. This is my code right here:

from selenium import webdriver
from webdriver_manager.chrome import ChromeDriverManager

browser = webdriver.Chrome(executable_path = 'SELE/chromedriver.exe')

browser.get("https://lolprofile.net/")

The code does runs, but the website only appeared for a second and then this set of problem code occurs:

[15696:7680:1231/111918.721:ERROR:device_event_log_impl.cc(211)] [11:19:18.721] USB: 
usb_device_handle_win.cc:1020 Failed to read descriptor from node connection: A device attached to the 
system is not functioning. (0x1F)

and now I can't continue the next step of my coding.

Jamuxi
  • 23
  • 1
  • 5
  • Hello Jamuxi, I think your issue is similiar to this [one](https://stackoverflow.com/questions/64927909/failed-to-read-descriptor-from-node-connection-a-device-attached-to-the-system) – Ice Bear Dec 31 '20 at 03:48

2 Answers2

1

This is not an error , but a warnign and it doesn't affect the run.

Browser closing is because python garbage collector is closing the chromedriver once the code execution completes

you can just add time.sleep() , or ask some user input("Enter any key to exit:") to stop code from exiting

PDHide
  • 18,113
  • 2
  • 31
  • 46
0

yes, I added the following code and it waits 3 seconds before closing...

    import time 
    << your chrome get code goes here >> 
    time.sleep(3)

I've seen some people get around this error message, but it's not trivial.

Try This...

    from selenium import webdriver
    from selenium.webdriver.chrome.options import Options
    options = webdriver.ChromeOptions()
    options.add_experimental_option('excludeSwitches', ['enable-logging'])
    driver = webdriver.Chrome(options=options)
    driver.get('https://something.com/login')
    driver.maximize_window()
Andres Martinez
  • 214
  • 2
  • 5