Chromedriver unknown error cannot find chrome binary

For compatibility reasons I prefer to use Chrome version 55.0.2883.75 with Chromedriver v. 2.26. I downloaded the older version of chrome from https://www.slimjet.com/chrome/google-chrome-old-versi...

This error message…

WebDriverException: unknown error: cannot find Chrome binary

…implies that the ChromeDriver was unable to find the Chrome binary in the default location for your system.

As per the ChromeDriver — Requirements:

The server expects you to have Chrome installed in the default location for each system:

OS Expected Location of Chrome
Linux /usr/bin/google-chrome1
Mac /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
Windows XP %HOMEPATH%Local SettingsApplication DataGoogleChromeApplicationchrome.exe
Windows Vista and newer C:Users%USERNAME%AppDataLocalGoogleChromeApplicationchrome.exe

1 For Linux systems, the ChromeDriver expects /usr/bin/google-chrome to be a symlink to the actual Chrome binary.


Using a Chrome executable in a non-standard location

However you can also override the default Chrome binary location as follows:

To use Chrome version 55.x installed in non standard location through ChromeDriver v2.26 you can use the following code:

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

options = Options()
options.binary_location = "C:\Program Files\Chrome\chrome64_55.0.2883.75\chrome.exe"
driver = webdriver.Chrome(chrome_options = options, executable_path=r'C:pathtochromedriver.exe')
driver.get('http://google.com/')
print("Chrome Browser Invoked")
driver.quit()

Related Docs


Reference

You can find a detailed discussion in:

  • Is Chrome installation needed or only chromedriver when using Selenium?

You fire up your Selenium-based Chrome browser automation operation(s) one fine day and you are greeted with a godawful bit of an exception, at the bottom of which you read the following:

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

Puzzled, “It was working optimally just yesterday!”, you think to yourself, wondering what the variable causing this could be. The infamously trusty Stack Overflow does not tell you much about this, except that you probably need to explicitly set the Google Chrome binary’s path as so:

...
chromeOptions = webdriver.ChromeOptions()
chromeOptions.binary_location = "C:Program
FilesGoogleChromeApplication" chromeDriver = "/chromedriver.exe"
driver = webdriver.Chrome(chromeDriver, options=chromeOptions)
...

But, “dude”—you ask yourself—”why should I explicitly set the Google Chrome binary’s path?” or maybe “Why was this not required just yesterday?”

Well, for the curious minds that made it here, may you have the strength of a thousand Suns, for we are a different people that consist of special gears in our heads that start “churning” once an inconsistency makes its way into our lives; and instead of just “fixing” the capsizing ship with a chunky roll of Flex tape (not sponsored) over the cracks and holes, we would like to know how it happened, what made it happen, and why it happened—as we abandon ship and auto-inflate our enormous life raft (using Selenium, of course, ’cause “automation”) and then sail off into the sunset as we code an Apache helicopter into existence (what ship? Pfft).

Now if there’s one thing you can be sure of, it’s that nothing is more powerful than a young boy’s wish. Except an Apache helicopter. An Apache helicopter has machine guns AND missiles. It is an unbelievably impressive complement of weaponry, an absolute death machine.” —Morgan-Freeman-sounding-but-not-Morgan-Freeman narrator — Ted (2012)

We have digressed far into the 3.5th dimension here; apologies, here’s the reason and possible fix!

Reason

NOTE: Just for the sake of clarity, this “Chrome binary” that Selenium is referring to is simply the OG big daddy main “Chrome.exe” file located in Google Chrome’s installation directory.

In previous versions of Google Chrome (v84 and below), Google Chrome’s default installation path—where “Chrome.exe” typically is—used to be:

C:UsersUSERNAMEAppDataLocalGoogle

But since the newer iteration(s) (v85 and above), the default installation path is:

C:Program FilesGoogle

Now, this is the problem. Where the older chromedriver.exe versions (v84 and below) intuitively expect the Chrome binary to be is in the former path, not the latter. If your Google Chrome browser naturally auto-updated from v84 to v85, this path remains unchanged (so chromedriver.exe has no issues navigating to it). However, if you explicitly installed or reinstalled Google Chrome on the latest version (v85 and above) recently, then the installation path changes to the newer one, and so, your older chromedriver.exe is not able to navigate to the Chrome binary; and this makes your code end with that particular “cannot find Chrome binary” exception. Ergo, this is why you are having to explicitly set the “binary_location” to the latter manually

NOTE: Since Google Chrome does not allow customizing the installation path while installing and just directly installs into Program Files by default, We have already tried a workaround and changed the default installation path itself from the registry (regedit); but to no avail, Google Chrome would then completely refuse to work once installed in the desired directory. It seems newer Google Chrome installations can only function if they are installed in the newer installation path.

Possible Fixes

Download the latest chromedriver.exe version that corresponds to your Google Chrome version (from here), and replace your existing chromedriver.exe with this new one.

Your problem should now be solved, since the newer chromedriver.exe is equipped with the knowledge that the new Google Chrome installation path is where it is supposed to look in order to find the Chrome binary.

But—for whatever reason—if you do not want to upgrade the chromedriver.exe version, you could just downgrade your Google Chrome version by obtaining an older version that corresponds to your chromedriver.exe version, uninstalling the newer version, and then installing the older version you had obtained.

NOTE: You will not find any official downloads for older Google Chrome versions since Google does not allow this for security reasons, but you may find some unofficial sources like this (personally tested and verified, safe). Also be informed that upon installing an older version of Google Chrome, auto-updates will no longer work anymore; so the only way for a potential future update would be via an uninstall and manual install of the latest Google Chrome version.

Labrador retriever puppy walking on green grass

Sometimes, we want to fix WebDriverException: unknown error: cannot find Chrome binary error with Selenium in Python for older versions of Google Chrome.

In this article, we’ll look at how to fix WebDriverException: unknown error: cannot find Chrome binary error with Selenium in Python for older versions of Google Chrome.

How to fix WebDriverException: unknown error: cannot find Chrome binary error with Selenium in Python for older versions of Google Chrome?

To fix WebDriverException: unknown error: cannot find Chrome binary error with Selenium in Python for older versions of Google Chrome, we set the path of the Chrome binary.

For instance, we write

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

options = Options()
options.binary_location = "C:\Program Files\Chrome\chrome64_55.0.2883.75\chrome.exe"
driver = webdriver.Chrome(chrome_options = options, executable_path=r'C:pathtochromedriver.exe')
driver.get('http://example.com/')
driver.quit()

to set create an Options object.

Then we set options.binary_location to the path of the Chrome binary.

And then we set the executable_path to the path of the Chrome driver.

Then we call get to open a page at the URL and call quit to exit.

Conclusion

To fix WebDriverException: unknown error: cannot find Chrome binary error with Selenium in Python for older versions of Google Chrome, we set the path of the Chrome binary.

Web developer specializing in React, Vue, and front end development.

View Archive

Issue

Had been trying to configure and have met with a lot of trouble, tried a lot of attempt but failed.

  • chromedriver=2.30.477691
  • Chrome 59.0.3071.115
  • Build info: version: ‘3.14.0’
  • Selenium 3.4
  • java.version: ‘1.8.0_121’
  • Linux 3.10.0-229.4.2.el7.x86_64 x86_64

Error:

unknown error: cannot find Chrome binary   (Driver info: chromedriver=2.30.477691 (6ee44a7247c639c0703f291d320bdf05c1531b57),platform=Linux 3.10.0-229.4.2.el7.x86_64 x86_64) (WARNING: The server did not provide any stacktrace information) Command duration or timeout: 59 milliseconds Build info: version: '3.14.0', revision: 'aacccce0', time: '2018-08-02T20:19:58.91Z' System info: host: '8f5b40c32460', ip: 'x', os.name: 'Linux', os.arch: 'amd64', os.version: '3.10.0-229.4.2.el7.x86_64', java.version: '1.8.0_121' Driver info: driver.version: ChromeDriver

Solution

This error message…

unknown error: cannot find Chrome binary   (Driver info: chromedriver=2.30.477691 (6ee44a7247c639c0703f291d320bdf05c1531b57),platform=Linux 3.10.0-229.4.2.el7.x86_64 x86_64) (WARNING: The server did not provide any stacktrace information) Command duration or timeout: 59 milliseconds Build info: version: '3.14.0', revision: 'aacccce0', time: '2018-08-02T20:19:58.91Z' System info: host: '8f5b40c32460', ip: 'x', os.name: 'Linux', os.arch: 'amd64', os.version: '3.10.0-229.4.2.el7.x86_64', java.version: '1.8.0_121' Driver info: driver.version: ChromeDriver

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

Your main issue is the incompatibility between the version of the binaries you are using as follows:

  • You are using chromedriver=2.30
  • Release Notes of chromedriver=2.30 clearly mentions the following :

Supports Chrome v58-60

  • You are using chrome=59.0
  • Your Selenium Client version is 3.14.0 of 2018-08-02T20:19:58.91Z which is almost 2.5 years older.
  • Your JDK version is 1.8.0_121 which is pretty ancient.

So there is a clear mismatch between JDK v8u121 , Selenium Client v3.14.1 , ChromeDriver v2.30 and the Chrome Browser v59.0


Solution

Ensure that:

  • JDK is upgraded to current levels JDK 8u232.
  • Selenium is upgraded to current levels Version 3.141.59.
  • ChromeDriver is updated to current ChromeDriver v79.0.3945.36 level.
  • Chrome is updated to current Chrome Version 79.0 level. (as per ChromeDriver v79.0 release notes)
  • Clean your Project Workspace through your IDE and Rebuild your project with required dependencies only.
  • If your base Web Client version is too old, then uninstall it through Revo Uninstaller and install a recent GA and released version of Web Client.
  • Take a System Reboot.
  • Execute your @Test as non-root user.
  • Always invoke driver.quit() within tearDown(){} method to close & destroy the WebDriver and Web Client instances gracefully.

Answered By — DebanjanB

Содержание

  1. unknown error: cannot find Chrome binary #177
  2. Comments
  3. Footer
  4. WebDriverError: unknown error: cannot find Chrome binary #3614
  5. Comments
  6. Fix: Selenium’s “cannot find Chrome binary” Error
  7. Reason
  8. Possible Fixes

unknown error: cannot find Chrome binary #177

Cannot find Chrome binary when executing a selenium (testng) test in jenkins on Ubuntu

org.openqa.selenium.WebDriverException:
unknown error: cannot find Chrome binary
(Driver info: chromedriver=2.33.506092 (733a02544d189eeb751fe0d7ddca79a0ee28cce4),platform=Linux 4.10.0-37-generic x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 9 milliseconds
Build info: version: ‘3.4.0’, revision: ‘unknown’, time: ‘unknown’
System info: host: ‘automation-tests-desktop’, ip: ‘127.0.1.1’, os.name: ‘Linux’, os.arch: ‘amd64’, os.version: ‘4.10.0-37-generic’, java.version: ‘1.8.0_151’
Driver info: driver.version: ChromeDriver

The text was updated successfully, but these errors were encountered:

Install Chrome on Jenkins. Typically, you will need Xvfb (X virtual framebuffer) too.

File «/usr/local/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py», line 312, in execute
self.error_handler.check_response(response)
File «/usr/local/lib/python3.6/site-packages/selenium/webdriver/remote/errorhandler.py», line 237, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: unknown error: cannot find Chrome binary
(Driver info: chromedriver=2.30,platform=Linux 3.10.0-693.17.1.el7.x86_64 x86_64)

org.openqa.selenium.WebDriverException: unknown error: cannot find Chrome binary
(Driver info: chromedriver=2.35.528139 (47ead77cb35ad2a9a83248b292151462a66cd881),platform=Linux 4.4.35-33.55.amzn1.x86_64 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 19 milliseconds
Build info: version: ‘3.7.1’, revision: ‘8a0099a’, time: ‘2017-11-06T21:01:39.354Z’
System info: host: ‘Unknown’, ip: ‘Unknown’, os.name: ‘Linux’, os.arch: ‘amd64’, os.version: ‘4.4.35-33.55.amzn1.x86_64’, java.version: ‘1.8.0_151’
Driver info: driver.version: ChromeDriver
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:214)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:166)
at org.openqa.selenium.remote.JsonWireProtocolResponse.lambda$new$0(JsonWireProtocolResponse.java:53)
at org.openqa.selenium.remote.JsonWireProtocolResponse.lambda$getResponseFunction$2(JsonWireProtocolResponse.java:91)
at org.openqa.selenium.remote.ProtocolHandshake.lambda$createSession$0(ProtocolHandshake.java:123)
at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
at java.util.Spliterators$ArraySpliterator.tryAdvance(Spliterators.java:958)
at java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:126)
at java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:498)
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:485)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
at java.util.stream.FindOps$FindOp.evaluateSequential(FindOps.java:152)
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.util.stream.ReferencePipeline.findFirst(ReferencePipeline.java:464)
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:126)
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:73)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:142)
at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:83)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:601)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:219)
at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:142)
at org.openqa.selenium.chrome.ChromeDriver.(ChromeDriver.java:181)
at org.openqa.selenium.chrome.ChromeDriver.(ChromeDriver.java:168)
at org.openqa.selenium.chrome.ChromeDriver.(ChromeDriver.java:123)
at Driver.driver.init(driver.java:42)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:124)
at org.testng.internal.MethodInvocationHelper.invokeMethodConsideringTimeout(MethodInvocationHelper.java:59)
at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:451)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:222)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:142)
at org.testng.internal.TestMethodWorker.invokeBeforeClassMethods(TestMethodWorker.java:163)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:105)
at org.testng.TestRunner.privateRun(TestRunner.java:648)
at org.testng.TestRunner.run(TestRunner.java:505)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:455)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:450)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:415)
at org.testng.SuiteRunner.run(SuiteRunner.java:364)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:84)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1187)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1116)
at org.testng.TestNG.runSuites(TestNG.java:1028)
at org.testng.TestNG.run(TestNG.java:996)
at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:295)
at org.apache.maven.surefire.testng.TestNGXmlTestSuite.execute(TestNGXmlTestSuite.java:84)
at org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:90)
at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:203)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:155)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)

@ChandraShekarReddy1996 i have the same problem, did you solve it?

Any solution yet? I have similar problem
selenium.common.exceptions.WebDriverException: Message: unknown error: no chrome binary

For java, I found that answer very helpful:

© 2023 GitHub, Inc.

You can’t perform that action at this time.

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.

Источник

WebDriverError: unknown error: cannot find Chrome binary #3614

I use protractor with a standalone Selenium Server and chrome browser
It work fine when I use Windows windows 7 but for Linux Binary chrome cannot be found.

I specified the binary’s path in attribute ‘chromeDriver’ for :

  • ‘./node_modules/webdriver-manager/selenium/chromedriver_2.22.exe’ (for Windows 7)** 👍
  • ‘./node_modules/webdriver-manager/selenium/chromedriver_2.22) (for Linux) 👎

I create 2 task in my gulptask file, one for update webdriver, and the other one to launch my tests.
These tasks are launched synchronously when webdriver-update is finish I launch my tests.

When I launch my tasks on Linux WebDriver cannot find Chrome binary

Download and unzip a this location by the task webdriver-update:
./node_modules/webdriver-manager/selenium/chromedriver_2.22linux64.zip

Protractor configuration file.
chromeDriver: ‘./node_modules/webdriver-manager/selenium/chromedriver_2.22’

[15:50:08] Using gulpfile /builds/lcab/lcab/Gulpfile.js
[15:50:08] Starting ‘protractor’.
[15:50:08] Starting ‘webdriver-update’.
webdriver-manager: using local installed version 10.2.3
[15:50:08] I/update — selenium standalone: file exists /builds/lcab/lcab/node_modules/webdriver-manager/selenium/selenium-server-standalone-2.53.1.jar
[15:50:08] I/update — selenium standalone: v2.53.1 up to date
[15:50:08] I/update — chromedriver: file exists /builds/lcab/lcab/node_modules/webdriver-manager/selenium/chromedriver_2.22linux64.zip
[15:50:08] I/update — chromedriver: unzipping chromedriver_2.22linux64.zip
[15:50:09] I/update — chromedriver: setting permissions to 0755 for /builds/lcab/lcab/node_modules/webdriver-manager/selenium/chromedriver_2.22
[15:50:09] I/update — chromedriver: v2.22 up to date
[15:50:09] Finished ‘webdriver-update’ after 698 ms
[15:50:09] Starting ‘e2e-tests’.
[15:50:09] D/launcher — Running with —troubleshoot
[15:50:09] D/launcher — Protractor version: 4.0.9
[15:50:09] D/launcher — Your base url for tests is http://.
[15:50:09] I/direct — Using ChromeDriver directly.
[15:50:09] I/launcher — Running 1 instances of WebDriver
[15:50:09] E/launcher — unknown error: cannot find Chrome binary
(Driver info: chromedriver=2.22.397932 (282ed7cf89cf0053b6542e0d0f039d4123bbb6ad),platform=Linux 4.7.0-coreos x86_64)
[15:50:09] E/launcher — WebDriverError: unknown error: cannot find Chrome binary
(Driver info: chromedriver=2.22.397932 (282ed7cf89cf0053b6542e0d0f039d4123bbb6ad),platform=Linux 4.7.0-coreos x86_64)
at WebDriverError (/builds/lcab/lcab/node_modules/selenium-webdriver/lib/error.js:27:5)
at Object.checkLegacyResponse (/builds/lcab/lcab/node_modules/selenium-webdriver/lib/error.js:639:15)
at parseHttpResponse (/builds/lcab/lcab/node_modules/selenium-webdriver/http/index.js:538:13)
at client_.send.then.response (/builds/lcab/lcab/node_modules/selenium-webdriver/http/index.js:472:11)
at ManagedPromise.invokeCallback_ (/builds/lcab/lcab/node_modules/selenium-webdriver/lib/promise.js:1379:14)
at TaskQueue.execute_ (/builds/lcab/lcab/node_modules/selenium-webdriver/lib/promise.js:2913:14)
at TaskQueue.executeNext_ (/builds/lcab/lcab/node_modules/selenium-webdriver/lib/promise.js:2896:21)
at asyncRun (/builds/lcab/lcab/node_modules/selenium-webdriver/lib/promise.js:2820:25)
at /builds/lcab/lcab/node_modules/selenium-webdriver/lib/promise.js:639:7
at process._tickCallback (internal/process/next_tick.js:103:7)
From: Task: WebDriver.createSession()
at Function.createSession (/builds/lcab/lcab/node_modules/selenium-webdriver/lib/webdriver.js:329:24)
at Driver (/builds/lcab/lcab/node_modules/selenium-webdriver/chrome.js:778:38)
at Direct.getNewDriver (/builds/lcab/lcab/node_modules/protractor/built/driverProviders/direct.js:68:26)
at Runner.createBrowser (/builds/lcab/lcab/node_modules/protractor/built/runner.js:198:43)
at /builds/lcab/lcab/node_modules/protractor/built/runner.js:277:30
at _fulfilled (/builds/lcab/lcab/node_modules/q/q.js:834:54)
at self.promiseDispatch.done (/builds/lcab/lcab/node_modules/q/q.js:863:30)
at Promise.promise.promiseDispatch (/builds/lcab/lcab/node_modules/q/q.js:796:13)
at /builds/lcab/lcab/node_modules/q/q.js:556:49
at runSingle (/builds/lcab/lcab/node_modules/q/q.js:137:13)
[15:50:09] E/launcher — Process exited with error code 199

/builds/lcab/lcab/app/Resources/gulpFiles/unitsTestingFront.js:52
throw e;
^
Error: protractor exited with code 199
ERROR: Build failed: exit code 1`

my protractor conf file

I’v tried to install chromedriver in nodes modules and add the chrome binary path to chromedriver attribute but it work only on window and I also try to add this conf to protractor but it seem to be deprecated :

The text was updated successfully, but these errors were encountered:

Источник

Fix: Selenium’s “cannot find Chrome binary” Error

Skip to entry content

You fire up your Selenium-based Chrome browser automation operation(s) one fine day and you are greeted with a godawful bit of an exception, at the bottom of which you read the following:

Puzzled, “It was working optimally just yesterday!”, you think to yourself, wondering what the variable causing this could be. The infamously trusty Stack Overflow does not tell you much about this, except that you probably need to explicitly set the Google Chrome binary’s path as so:

But, “dude”—you ask yourself—”why should I explicitly set the Google Chrome binary’s path?” or maybe “Why was this not required just yesterday?”

Well, for the curious minds that made it here, may you have the strength of a thousand Suns, for we are a different people that consist of special gears in our heads that start “churning” once an inconsistency makes its way into our lives; and instead of just “fixing” the capsizing ship with a chunky roll of Flex tape (not sponsored) over the cracks and holes, we would like to know how it happened, what made it happen, and why it happened—as we abandon ship and auto-inflate our enormous life raft (using Selenium, of course, ’cause “automation”) and then sail off into the sunset as we code an Apache helicopter into existence (what ship? Pfft).

Now if there’s one thing you can be sure of, it’s that nothing is more powerful than a young boy’s wish. Except an Apache helicopter. An Apache helicopter has machine guns AND missiles. It is an unbelievably impressive complement of weaponry, an absolute death machine. ” —Morgan-Freeman-sounding-but-not-Morgan-Freeman narrator — Ted (2012)

We have digressed far into the 3.5 th dimension here; apologies, here’s the reason and possible fix!

Reason

NOTE: Just for the sake of clarity, this “Chrome binary” that Selenium is referring to is simply the OG big daddy main “Chrome.exe” file located in Google Chrome’s installation directory.

In previous versions of Google Chrome (v84 and below), Google Chrome’s default installation path—where “Chrome.exe” typically is—used to be:

But since the newer iteration(s) (v85 and above), the default installation path is:

Now, this is the problem. Where the older chromedriver.exe versions (v84 and below) intuitively expect the Chrome binary to be is in the former path, not the latter. If your Google Chrome browser naturally auto-updated from v84 to v85, this path remains unchanged (so chromedriver.exe has no issues navigating to it). However, if you explicitly installed or reinstalled Google Chrome on the latest version (v85 and above) recently, then the installation path changes to the newer one, and so, your older chromedriver.exe is not able to navigate to the Chrome binary; and this makes your code end with that particular “cannot find Chrome binary” exception. Ergo, this is why you are having to explicitly set the “binary_location” to the latter manually

NOTE: Since Google Chrome does not allow customizing the installation path while installing and just directly installs into Program Files by default, We have already tried a workaround and changed the default installation path itself from the registry (regedit); but to no avail, Google Chrome would then completely refuse to work once installed in the desired directory. It seems newer Google Chrome installations can only function if they are installed in the newer installation path.

Possible Fixes

Download the latest chromedriver.exe version that corresponds to your Google Chrome version (from here ), and replace your existing chromedriver.exe with this new one.

Your problem should now be solved, since the newer chromedriver.exe is equipped with the knowledge that the new Google Chrome installation path is where it is supposed to look in order to find the Chrome binary.

But—for whatever reason—if you do not want to upgrade the chromedriver.exe version, you could just downgrade your Google Chrome version by obtaining an older version that corresponds to your chromedriver.exe version, uninstalling the newer version, and then installing the older version you had obtained.

NOTE: You will not find any official downloads for older Google Chrome versions since Google does not allow this for security reasons, but you may find some unofficial sources like this (personally tested and verified, safe). Also be informed that upon installing an older version of Google Chrome, auto-updates will no longer work anymore; so the only way for a potential future update would be via an uninstall and manual install of the latest Google Chrome version.

Источник

Hello Guys, How are you all? Hope You all Are Fine. Today I am just trying to set my Chrome binary location in my selenium webdriver But I am facing following error WebDriverException: unknown error: cannot find Chrome binary error with Selenium in Python for older versions of Google Chrome in python. So Here I am Explain to you all the possible solutions here.

Without wasting your time, Let’s start This Article to Solve This Error.

Contents

  1. How WebDriverException: unknown error: cannot find Chrome binary error with Selenium in Python for older versions of Google Chrome Error Occurs ?
  2. How To Solve WebDriverException: unknown error: cannot find Chrome binary error with Selenium in Python for older versions of Google Chrome Error ?
  3. Solution 1: Use this code
  4. Solution 2: Make sure chrome browser is installed
  5. Summary

I am just trying to set my Chrome binary location in my selenium webdriver But I am facing following error.

WebDriverException: unknown error: cannot find Chrome binary
(Driver info: chromedriver=2.26.436362
(5476ec6bf7ccbada1734a0cdec7d570bb042aa30),platform=Windows NT 10.0.14393 x86_64)

How To Solve WebDriverException: unknown error: cannot find Chrome binary error with Selenium in Python for older versions of Google Chrome Error ?

  1. How To Solve WebDriverException: unknown error: cannot find Chrome binary error with Selenium in Python for older versions of Google Chrome Error ?

    To Solve WebDriverException: unknown error: cannot find Chrome binary error with Selenium in Python for older versions of Google Chrome Error Just make sure that you have chrome browser is installed If you dont have then just Download the browser and it fixes this issue.

  2. WebDriverException: unknown error: cannot find Chrome binary error with Selenium in Python for older versions of Google Chrome

    To Solve WebDriverException: unknown error: cannot find Chrome binary error with Selenium in Python for older versions of Google Chrome Error Just make sure that you have chrome browser is installed If you dont have then just Download the browser and it fixes this issue.

Solution 1: Use this code

Just use following code and you can set your binary path then your error will be solved.

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

options = Options()
options.binary_location = "C:\Program Files\Chrome\chrome64_55.0.2883.75\chrome.exe"
driver = webdriver.Chrome(chrome_options = options, executable_path=r'C:pathtochromedriver.exe')
driver.get('http://google.com/')
print("Chrome Browser Invoked successfully")
driver.quit()

Solution 2: Make sure chrome browser is installed

Just make sure that you have chrome browser is installed If you dont have then just Download the browser and it fixes this issue.

Summary

It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you?

Also, Read

  • certificate verify failed: unable to get local issuer certificate

I am trying to run selenium using chrome-driver in my project. While creating object of chrome-driver facing errors :

Message «unknown error: cannot find Chrome binaryn
(Driver info: chromedriver=81.0.4044.20

Please let me know if anyone face/fix this issue.

Error 1 :

{«unknown error: Chrome failed to start: crashed.n (unknown error: DevToolsActivePort file doesn’t exist)

Error 2 :

{«unknown error: Failed to create a Chrome process.n (Driver info: chromedriver=2.41.578737

asked Apr 28, 2021 at 10:46

Narendra Chandratre's user avatar

Chrome is currently on v91 and it needs a driver to match. Install Chrome in its default location and make sure it is updated. Then get the latest Chromedriver. There’s a NuGet package for chromedriver if you prefer to manage it that way.

answered Apr 28, 2021 at 13:05

kirbycope's user avatar

5

Понравилась статья? Поделить с друзьями:
  • Cisco anyconnect install error
  • Cisco 7911 error dbconfig
  • Chrome ошибка сети при скачивании
  • Chrome ошибка сертификата
  • Chrome ошибка при запуске приложения 0xc0000022