Skip to content

selenium.common.exceptions.WebDriverException: Message: unknown error: cannot connect to chrome at 127.0.0.1:9222 #2314

Closed
@iamumairayub

Description

@iamumairayub

I have had SB (SeleniumBase) working pretty well with UC mode (without any virtualdisplay/xvfb) and I was getting an error "You are using a Chromium-based browser" when testing with https://pixelscan.net

So I decided to run command sudo snap remove chromium and then I started getting error

selenium.common.exceptions.WebDriverException: Message: unknown error: cannot connect to chrome at 127.0.0.1:9222

Here is my most basic code, it works well with uc=False but it is not what I want.

options = Options()
options.add_argument('--no-sandbox')
options.add_argument('--disable-dev-shm-usage')
driver = Driver(
    uc=True,
    headless=True,
    cap_string=options.to_capabilities(),
)
driver.uc_open_with_reconnect("https://pixelscan.net/", reconnect_time=10)

Tried commenting our cap_string
Tried sudo snap install chromium
Tried uninstalling and installing undetected_chromedriver again
Tried uninstalling and installing seleniumbase again

I saw an issue on SB issues and also on https://github.com/ultrafunkamsterdam/undetected-chromedriver/issues but those solutions/workarounds did not help.

Distributor ID: Ubuntu
Description: Ubuntu 20.04.5 LTS
Release: 20.04
Codename: focal

google-chrome --version
Google Chrome 119.0.6045.159

Python 3.10.7

seleniumbase.version
'4.21.4'

Metadata

Metadata

Assignees

No one assigned

    Labels

    UC Mode / CDP ModeUndetected Chromedriver Mode / CDP ModeduplicateThe answer/solution already exists somewhereexternalOutside SeleniumBase's scope. / Ask somewhere else.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions