Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cannot find Chrome binary error. #578

Closed
dimaklepikov opened this issue Jul 28, 2023 · 9 comments
Closed

cannot find Chrome binary error. #578

dimaklepikov opened this issue Jul 28, 2023 · 9 comments

Comments

@dimaklepikov
Copy link

dimaklepikov commented Jul 28, 2023

After updating to 4.0.0 version on Mac OS (arm64) , the following code throws an error:

# Manager
from selenium import webdriver
from webdriver_manager.chrome import ChromeDriverManager
from selenium.webdriver.chrome.service import Service as ChromeService


def chrome(version=None):
    """Creates driver instance of Chrome"""

    path = ChromeDriverManager(driver_version=version).install()
    return webdriver.Chrome(
        service=ChromeService(executable_path=path)
    )


print(chrome())

### Ouutput:
selenium.common.exceptions.WebDriverException: Message: unknown error: cannot find Chrome binary

TEMPORARY SOLUTION:
Passing a path to a Chrome browser binary itself works, but that's not a ChromeDriver instance.
E.g:
path = "/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome"

What may cause this issue?

@ndepaola
Copy link
Contributor

could this be related to this selenium bug? SeleniumHQ/selenium#12381

@Whysman2
Copy link

If you're wondering why you're now seeing this error for ChromeDriverManager, it's because https://chromedriver.chromium.org/downloads only goes up to version 114 due to driver restructuring by the Chromium Team for the new Chrome-for-Testing.

Webdriver-manager needs to be updated so it can read the new location for drivers.

@gregoriopellegrino
Copy link

Same error here. Any quick solution?

@fecaridade
Copy link

fecaridade commented Jul 28, 2023

@gregoriopellegrino

I made a temporary solution in my code and managed to use it

driver = webdriver.Chrome(
options=options,
service=ChromeService(
ChromeDriverManager(version="114.0.5735.90").install()
),
)

passing the argument to "version" in ChromeDriverManager.

i'm using:

webdriver-manager==3.8.6
selenium==4.7.2

@vickvick3110
Copy link

vickvick3110 commented Jul 29, 2023

I am currently using this, which works well on my Mac with the ARM M1 processor. Specifically, I am using Chrome version 115. I hope this tool will be up and running again soon.

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

option = webdriver.ChromeOptions()
option.add_argument("start-maximized")

driver = webdriver.Chrome(service=Service(ChromeDriverManager("114.0.5735.16").install()), options=option)

@cKurultayKalkan
Copy link

+1 Same here. Downgrade back to 3.9.1 solved the issue for now.

@SergeyPirogov
Copy link
Owner

You have to put chrome browser path using ChromeOptions, see example here

def test_chrome_manager_with_selenium():

@leomm20
Copy link

leomm20 commented Jul 31, 2023

You just could do this:

self.driver = webdriver.Chrome(options=chrome_options,
                                           service=ChromeService(ChromeDriverManager(version="latest").install()))

It will take the last version of the repository.

An improvement could be comparing the version of the browser with the latest:
core\utils.py
line 226:

        try:
            latest = requests.get('https://chromedriver.storage.googleapis.com/LATEST_RELEASE').text
            if version > latest:
                version = latest
        except:
            pass
        return version

@jamesbcd
Copy link

jamesbcd commented Aug 2, 2023

You have to put chrome browser path using ChromeOptions, see example here

def test_chrome_manager_with_selenium():

@SergeyPirogov, is there an easy and reliable way to set the chrome browser path without an extra dependency like pybrowsers?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants