0

Following the solution here, I explicitly gave the path to the Chrome Binary, but I am still getting the "Cannot fine chrome binary" error:

My code:

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

options = Options()
options.binary_location = "C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe"
path = "C:\\Program Files (x86)\\chromedriver_win32\\chromedriver.exe"


driver = webdriver.Chrome(options = options, executable_path=path)

Location of Chrome Binary on my computer:

enter image description here

Location of ChromeDriver on my computer:

enter image description here

The error I am getting:

WebDriverException: Message: unknown error: cannot find Chrome binary
  (Driver info: chromedriver=2.15.322448 (52179c1b310fec1797c81ea9a20326839860b7d3),platform=Windows NT 10.0 x86_64)

My browser says I have an updated version but not sure if that impacts the binary as mentioned in the comment by Arundeep.

enter image description here

enter image description here

enter image description here

EDIT:

I finally got it to work. There were two things that I had to do.

I placed the Chromedriver.exe into the same folder as Chrome.exe. This gave me a new error. "Selenium: Runtime.executionContextCreated has invalid 'context':"

Then I downloaded Chromedriver again and I realized what my mistake might have been. While unzipping ChromeDriver, initially I might have clicked "skip" when it asked me if I wanted to replace the existing file. This time I didn't and it worked.

Amatya
  • 1,203
  • 6
  • 32
  • 52

0 Answers0