Software Development

What is the correct way to set up and configure Chrome Driver with Selenium on MacOS?

SA Asked by Sarah Jenkins · 14-09-2024
0 upvotes 14,991 views 0 comments
The question

I am trying to initiate a web automation project on my Mac, but I’m struggling with the Chrome Driver setup. I keep getting "developer cannot be verified" errors or "path not found" exceptions when I try to run my Python scripts. Should I be manually moving the binary to /usr/local/bin, or is there a more modern way to manage these drivers automatically to ensure they always match my current Chrome browser version?

3 answers

0
JE
Answered on 17-09-2024

The most efficient way to handle this on MacOS is using the webdriver-manager library, which eliminates the need to manually download binaries. Simply run pip install webdriver-manager and then initialize your driver with Service(ChromeDriverManager().install()). If you prefer the manual route, you must download the version matching your browser from the official Chrome for Testing dashboard. After moving the binary to /usr/local/bin, you often need to run xattr -d com.apple.quarantine /usr/local/bin/chromedriver in the terminal to bypass the MacOS security gatekeeper that blocks unidentified developers.

0
MI
Answered on 19-09-2024

Are you using an Intel-based Mac or the newer Apple Silicon M1/M2/M3 chips, as downloading the wrong architecture version of the binary is a common cause for the driver failing to execute?

RO 21-09-2024

That’s a great point, Michael. I am on an M2 Macbook Air. If I accidentally downloaded the x64 version instead of the arm64 version, would the error message explicitly mention architecture mismatch, or would it just give me a generic "service reached unexpected status" error? I want to make sure I’m looking at the right logs before I start moving files around in my system directories again.

0
SU
Answered on 24-09-2024

I always use Homebrew for this. Just run brew install --cask chromedriver and it sets the paths for you. It’s much cleaner than dragging files into hidden system folders manually.

SA 26-09-2024

I agree with Susan. Homebrew is definitely the way to go for Mac users. Just remember that if Chrome updates automatically, you might need to run brew upgrade to keep the driver in sync with the browser app.

Share your thoughts

Your email address will not be published. Required fields are marked (*)

Professional Counselling Session

Still have questions?
Schedule a free counselling session

Our experts are ready to help you with any questions about courses, admissions, or career paths. Get personalized guidance from industry professionals.

Request a Call Back

Search Online

We Accept

We Accept

Follow Us

"PMI®", "PMBOK®", "PMP®", "CAPM®" and "PMI-ACP®" are registered marks of the Project Management Institute, Inc. | "CSM", "CST" are Registered Trade Marks of The Scrum Alliance, USA. | COBIT® is a trademark of ISACA® registered in the United States and other countries.

Book Free Session