3

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?

halfer
  • 19,471
  • 17
  • 87
  • 173
Sid
  • 3,203
  • 5
  • 24
  • 53

3 Answers3

4

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())
Vova
  • 2,425
  • 2
  • 9
  • 18
3

The fastest way to to solve is using Home Brew:

brew install --cask chromedriver

Chromedriver will be installed in the correct path.

  • FWIW after install via `brew` I still needed to mark the application as "safe" in macOS, I followed the instructions here: https://stackoverflow.com/a/60362134/1371489 – jlhasson Mar 29 '22 at 00:25
0

You can find the downloads for various versions of the Chrome driver here: https://chromedriver.chromium.org/downloads

For example, for v99 on Mac M1 you could download this archive: https://chromedriver.storage.googleapis.com/99.0.4844.51/chromedriver_mac64_m1.zip

Once downloaded just unzip & copy to whatever location you choose. After I installed I still needed to mark the application as "safe" in macOS, I followed the instructions here: https://stackoverflow.com/a/60362134/1371489

jlhasson
  • 517
  • 1
  • 6
  • 18