Install chromedriver on Mac M1 at specific location?

Viewed 9446

I just made the jump from Ubuntu to MacBook Air M1.

I am trying to set-up the system in a way that I don't have to change scripts for both. i.e. I want to keep the scripts in such a way that editing on either system is ok.

In a script I use the following line of code:

driver = webdriver.Chrome("/usr/lib/chromium-browser/chromedriver")

I used Homebrew to install chromium-browser but I can't find the file (so I can move it to this location?).

I have tried almost everything I could look up and can't figure it out. What can I try next?

3 Answers

Install webdriver-manager, it allows you install and store chromedrive automatically

pip install webdriver-manager

and use like this:

from selenium import webdriver
from webdriver_manager.chrome import ChromeDriverManager
driver = webdriver.Chrome(ChromeDriverManager().install())

The fastest way to to solve is using Home Brew:

brew install --cask chromedriver

Chromedriver will be installed in the correct path.

Related