Selenium throws an error “selenium.common.exceptions.WebDriverException:

0 votes

With the message: unknown error: cannot find Chrome binary” on Mac

I was using Selenium with Python 3 for web scraping purposes:

from selenium import webdriver

chrome_path = r"/Library/Frameworks/Python.framework/Versions/3.6/bin/chromedriver"

driver = webdriver.Chrome(chrome_path)

I got an error

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

May 8, 2018 in Selenium by Martin
• 4,220 points
1,775 views

1 answer to this question.

0 votes
In your case the path of the chrome is at a non-default path. So, you need to specify the complete path to the Google Chrome binary.

options = webdriver.ChromeOptions()

options.binary_location = "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"

chrome_driver_binary = "/usr/local/bin/chromedriver"

driver = webdriver.Chrome(chrome_driver_binary, chrome_options=options)

Above code is what you should use
answered May 8, 2018 by Samarpit
• 5,130 points

Related Questions In Selenium

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

Finding WebDriver element with Class Name in java

The better way to handle this element ...READ MORE

answered Apr 10, 2018 in Selenium by nsv999
• 5,050 points
281 views
0 votes
1 answer
0 votes
1 answer

Geo-location microphone camera pop up

To Allow or Block the notification, access using Selenium and you have to ...READ MORE

answered May 11, 2018 in Selenium by Samarpit
• 5,130 points
642 views
0 votes
1 answer

How to use such xpath to find web elements

It's much simpler to use: #MyDiv123 > div.super or ...READ MORE

answered Jun 14, 2018 in Selenium by Samarpit
• 5,130 points
270 views
0 votes
1 answer

How to eliminate this error”Cannot instantiate the type Select in selenium webdriver”

Try below code. Select sc = new Select(driver.findElement(By.xpath("your ...READ MORE

answered May 18, 2018 in Selenium by Samarpit
• 5,130 points
1,216 views