0

I have a CentOS 7 OS install on my server. I am trying to deploy my selenium bot but I got this error.

selenium.common.exceptions.WebDriverException: Message: Can not connect to the Service /root/.wdm/drivers/chromedriver/linux64/90.0.4430.24/chromedriver

I tried many solutions as given on the internet but none of them work. Maybe I am doing some silly mistake. If anyone helps me I will be very thankful. That's my sample code.

from selenium import webdriver
from webdriver_manager.chrome import ChromeDriverManager
from selenium.webdriver.chrome.options import Options

class BeachVolleyBall:

def __init__(self):
    self.base_url = 'https://www.volleyball.world'
    self.session = requests.Session()
    self.options = Options()
    self.options.add_argument('--no-sandbox')
    self.options.add_argument('disable-blink-features=AutomationControlled')
    self.options.add_argument('--lang=en_US') 
    # self.options.add_argument('--headless')
    self.options.add_argument("--start-maximized")
    self.driver = webdriver.Chrome(ChromeDriverManager().install(), options=self.options)

I am getting error on the last line. Full error is

Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 2464, in __call__
    return self.wsgi_app(environ, start_response)
  File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 2450, in wsgi_app
    response = self.handle_exception(e)
  File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1867, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/local/lib/python3.6/site-packages/flask/_compat.py", line 39, in reraise
    raise value
  File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 2447, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1952, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1821, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/local/lib/python3.6/site-packages/flask/_compat.py", line 39, in reraise
    raise value
  File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1950, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1936, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/home/ballsquad/public_html/bvbot_subdomain/API.py", line 10, in bvb_data
    bvb = BeachVolleyBall()
  File "/home/ballsquad/public_html/bvbot_subdomain/BeachVolleyBall.py", line 34, in __init__
    self.driver = webdriver.Chrome(ChromeDriverManager().install(), options=self.options)
  File "/usr/local/lib/python3.6/site-packages/selenium/webdriver/chrome/webdriver.py", line 73, in __init__
    self.service.start()
  File "/usr/local/lib/python3.6/site-packages/selenium/webdriver/common/service.py", line 104, in start
    raise WebDriverException("Can not connect to the Service %s" % self.path)
selenium.common.exceptions.WebDriverException: Message: Can not connect to the Service /root/.wdm/drivers/chromedriver/linux64/90.0.4430.24/chromedriver

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.