Home > Enterprise >  I dont understand this output using selenium chromedriver (python)
I dont understand this output using selenium chromedriver (python)

Time:09-30

I'm working with the selenium chrome webdriver in python, but it doesn't work and it crashed any time I run the code. This is the output, and I sincerally don't know what to do.

from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from webdriver_manager.chrome import ChromeDriverManager

driver=webdriver.Chrome(service=Service(ChromeDriverManager().install()))
driver.get("https://www.google.com")
DevTools listening on ws://127.0.0.1:58441/devtools/browser/a6122e07-0d3e-49ea-9308-d5c4dc4461ab
[19592:21540:0929/222340.633:ERROR:gpu_process_host.cc(968)] GPU process launch failed: error_code=2
[19592:21540:0929/222340.664:ERROR:gpu_process_host.cc(968)] GPU process launch failed: error_code=2
[19592:21540:0929/222340.671:ERROR:gpu_process_host.cc(968)] GPU process launch failed: error_code=2
[19592:21540:0929/222340.686:ERROR:gpu_process_host.cc(968)] GPU process launch failed: error_code=2
[19592:21540:0929/222340.693:ERROR:gpu_process_host.cc(968)] GPU process launch failed: error_code=2
[19592:21540:0929/222340.695:ERROR:gpu_process_host.cc(968)] GPU process launch failed: error_code=2
[19592:21540:0929/222340.698:ERROR:device_event_log_impl.cc(214)] [22:23:40.698] USB: usb_service_win.cc:415 Could not read device interface GUIDs: El sistema no puede encontrar el archivo especificado. (0x2)
[19592:21540:0929/222340.698:ERROR:gpu_process_host.cc(968)] GPU process launch failed: error_code=2
[19592:21540:0929/222340.700:ERROR:device_event_log_impl.cc(214)] [22:23:40.700] USB: usb_device_handle_win.cc:1048 Failed to read descriptor from node connection: Uno de los dispositivos conectados al sistema no funciona. (0x1F)
[19592:21540:0929/222340.705:ERROR:gpu_process_host.cc(968)] GPU process launch failed: error_code=2
[19592:21540:0929/222340.712:ERROR:gpu_process_host.cc(968)] GPU process launch failed: error_code=2
[19592:21540:0929/222340.712:FATAL:gpu_data_manager_impl_private.cc(441)] GPU process isn't usable. Goodbye.

After that, it just shows a crash message:

Traceback (most recent call last):
  File "c:\Users\marti\OneDrive\Escritorio\woo\DiscordBot\BetterCollege\tester.py", line 5, in <module>
    driver=webdriver.Chrome(service=Service(ChromeDriverManager().install()))
  File "C:\Users\marti\AppData\Local\Programs\Python\Python38\lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 69, in __init__
    super().__init__(DesiredCapabilities.CHROME['browserName'], "goog",
  File "C:\Users\marti\AppData\Local\Programs\Python\Python38\lib\site-packages\selenium\webdriver\chromium\webdriver.py", line 92, in __init__
    super().__init__(
  File "C:\Users\marti\AppData\Local\Programs\Python\Python38\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 272, in __init__
    self.start_session(capabilities, browser_profile)
  File "C:\Users\marti\AppData\Local\Programs\Python\Python38\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 364, in start_session
    response = self.execute(Command.NEW_SESSION, parameters)
  File "C:\Users\marti\AppData\Local\Programs\Python\Python38\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 429, in execute
    self.error_handler.check_response(response)
  File "C:\Users\marti\AppData\Local\Programs\Python\Python38\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 243, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: unknown error: Chrome failed to start: crashed.
  (chrome not reachable)
  (The process started from chrome location C:\Program Files\Google\Chrome\Application\chrome.exe is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
Stacktrace:
Backtrace:
        Ordinal0 [0x00EB1ED3 2236115]
        Ordinal0 [0x00E492F1 1807089]
        Ordinal0 [0x00D566FD 812797]
        Ordinal0 [0x00D758F9 940281]
        Ordinal0 [0x00D719C9 924105]
        Ordinal0 [0x00DA806C 1146988]
        Ordinal0 [0x00DA7A6A 1145450]
        Ordinal0 [0x00DA18A6 1120422]
        Ordinal0 [0x00D7A73D 960317]
        Ordinal0 [0x00D7B71F 964383]
        GetHandleVerifier [0x0115E7E2 2743074]
        GetHandleVerifier [0x011508D4 2685972]
        GetHandleVerifier [0x00F42BAA 532202]
        GetHandleVerifier [0x00F41990 527568]
        Ordinal0 [0x00E5080C 1837068]
        Ordinal0 [0x00E54CD8 1854680]
        Ordinal0 [0x00E54DC5 1854917]
        Ordinal0 [0x00E5ED64 1895780]
        BaseThreadInitThunk [0x768F6739 25]
        RtlGetFullPathName_UEx [0x77658FD2 1218]
        RtlGetFullPathName_UEx [0x77658F9D 1165]

Can someone help me? :c

CodePudding user response:

I would suggest getting a chrome driver that is your around your chrome version from here: Chrome Driver Then put it in the path of the folder and check out the following code:

from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from webdriver_manager.chrome import ChromeDriverManager

driver=webdriver.Chrome(executable_path = "chromedriver.exe")
driver.get("https://www.google.com")

CodePudding user response:

Try to update both Chrome driver and Chrome browser to the latest version making sure they both have the same version number.

  • Related