pythonseleniumselenium-chromedriverwebdriver-managerwebdrivermanager-python

WebDriverException: Message: Service /root/.wdm/drivers/chromedriver/linux64/104.0.5112/chromedriver unexpectedly exited error using WebDriverManager


I was trying some scraping using selenium, but when I try to run this code I got this error:

The version I am currently working on.

Python -- 3.7.13

Selenium -- 4.4.3

webdrivermanager -- 0.10.0

from webdriver_manager.chrome import ChromeDriverManager
driver = webdriver.Chrome(ChromeDriverManager().install())

Error:

WebDriverException                        Traceback (most recent call last)
<ipython-input-30-470b559d9ec4> in <module>
      2 from selenium import webdriver
      3 from webdriver_manager.chrome import ChromeDriverManager
----> 4 driver = webdriver.Chrome(ChromeDriverManager().install())
      5 import pandas as pd
      6 import time

3 frames
/usr/local/lib/python3.7/dist-packages/selenium/webdriver/common/service.py in assert_process_still_running(self)
    110             raise WebDriverException(
    111                 'Service %s unexpectedly exited. Status code was: %s'
--> 112                 % (self.path, return_code)
    113             )
    114 

WebDriverException: Message: Service /root/.wdm/drivers/chromedriver/linux64/104.0.5112/chromedriver unexpectedly exited. Status code was: -6

Solution

  • This error message...

    WebDriverException: Message: Service /root/.wdm/drivers/chromedriver/linux64/104.0.5112/chromedriver unexpectedly exited. Status code was: -6
    

    ...implies that the ChromeDriver was unable to initiate/spawn a new Browsing Context i.e.


    Details

    There seems to some issue with download path of_ChromeDriver v104.0.5112.79_. As per the error message Selenium was searching for the ChromeDriver within:

    /root/.wdm/drivers/chromedriver/linux64/104.0.5112/chromedriver
    

    Presumably, following Index of /104.0.5112.79/ the ideal location should have been:

    /root/.wdm/drivers/chromedriver/linux64/104.0.5112.79/chromedriver
    

    This issue have been raised as ChromeDriverManager tries to download the latest ChromeDriver from incorrect url. Feel free to add up your observations to help us debug and address the issue.