Webdriver chrome is not working when express VPN is connected



  • I am facing the below issue -

    Environment Chrome version - Version 86.0.4240.75 (Official Build) (64-bit) chrome driver - ChromeDriver 86.0.4240.22 (downloaded from https://chromedriver.chromium.org/downloads) python 3.6.6 32 bit selenium - 3.141.0 ExpressVPN connected Windows 10 Pro 64 bit system

    Code

    from selenium.webdriver.chrome.options import Options
    from selenium import webdriver
    driver = webdriver.Chrome(options=options, executable_path='D:/chromedriver_win32/chromedriver.exe')
    

    Execution output

    D:\Assignment>python add_to_cart_v3.py
    
    DevTools listening on ws://127.0.0.1:59948/devtools/browser/b3bea32b-25a1-47ff-800c-162e0200566a
    Traceback (most recent call last):
      File "add_to_cart_v3.py", line 67, in <module>
        driver = webdriver.Chrome(options=options, executable_path=r'D:/chromedriver_win32/chromedriver.exe')
      File "C:\Users\pc\AppData\Local\Programs\Python\Python36-32\lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 81, in __init__
        desired_capabilities=desired_capabilities)
      File "C:\Users\pc\AppData\Local\Programs\Python\Python36-32\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 157, in __init__
        self.start_session(capabilities, browser_profile)
      File "C:\Users\pc\AppData\Local\Programs\Python\Python36-32\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 252, in start_session
        response = self.execute(Command.NEW_SESSION, parameters)
      File "C:\Users\pc\AppData\Local\Programs\Python\Python36-32\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute
        self.error_handler.check_response(response)
      File "C:\Users\pc\AppData\Local\Programs\Python\Python36-32\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response
        raise exception_class(message, screen, stacktrace)
    selenium.common.exceptions.WebDriverException: Message: chrome not reachable
    

    When I disconnect the Express VPN, it works fine. Please share your inputs about what could be the issue here.



  • Try this, I have the same issue with surfshark but this fixed. install webdriver_manager using pip. with webdriver_manager there is no need to download chromedriver it automatically detects your chrome version.

    from selenium.webdriver.chrome.options import Options
    from selenium import webdriver
    from webdriver_manager.chrome import ChromeDriverManager
    options = webdriver.ChromeOptions()
    driver = webdriver.Chrome(ChromeDriverManager().install(),options=options)
    


Suggested Topics

  • 3
  • 2
  • 2
  • 2
  • 2