# Installing Selenium on MacOS: A Step-by-Step Guide

### Introduction

In this comprehensive guide, we will explore the step-by-step process of installing Selenium on MacOS, enabling you to harness the power of this versatile tool for web browser automation.

Selenium is a widely-used package in the Python programming language that allows developers to automate web browser interactions seamlessly. By leveraging the capabilities of Selenium, one can efficiently perform tasks such as web scraping, browser testing, and automating repetitive actions, ultimately streamlining the overall development process.

## Supported programming languages

Selenium supports be installed for several programming languages with what they call WebDrivers:

* ### **For python:**
    

> After a fresh Xcode installation, add command line tools by executing `xcode-select --install` in the terminal to enable seamless web browser automation using Python's Selenium package.

For installing [Selenium](https://www.selenium.dev/) for Python we are gonna need some prerequisites:

* Install [Homebrew](https://brew.sh/) a package manager for macOS
    
* Install [Python](https://www.python.org/) programming language, we'll benefit from its [`pip package installer`](https://pypi.org/)
    

```bash
brew install python3

# then make sure you have the latest version of pip
pip install --upgrade pip
```

* Install Selenium
    

```bash
pip install selenium
```

* ### **For Javascript**
    

It is straightforward, just install it from your preferred registry package manager:

```bash
npm install selenium-webdriver

# package.json dependency array
"selenium-webdriver": "^4.9.0"
```

* ### For Ruby
    

```bash
gem install selenium-webdriver

# add to project gemfile
gem 'selenium-webdriver', '= 4.9.0'
```

* ### For .NET
    

```bash
Install-Package Selenium.WebDriver

# .NET CLI 
dotnet add package Selenium.WebDriver

# Reference it
<PackageReference Include="Selenium.WebDriver" Version="4.9.0" />
```

## Bonus

* Example with Node
    

Let's install a couple of libraries from npm:

```bash
npm install selenium-webdriver
npm install chromedriver
```

This code snipped will open a Chrome window and redirect to the website you set in the `driver.get` function:

```javascript
const { Builder } = require('selenium-webdriver');
require("chromedriver");

(async function helloSelenium() {
    let driver = await new Builder().forBrowser('chrome').build();

    await driver.get('https://blog.aiherrera.com');
})();
```

and also you'll notice a message telling you that: `Chrome is being controlled by automated test software.`

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1683173164261/1e818e17-3830-4be7-a305-f46d4856efba.png align="center")

* Extensions
    

There are also extensions for some of the most popular browsers that are called IDE as stated on Selenium's website:

> Selenium IDE is a Chrome, Firefox and Edge plugin which records and plays back user interactions with the browser. Use this to either create simple scripts or assist in exploratory testing.

1. [Chrome](https://chrome.google.com/webstore/detail/selenium-ide/mooikfkahbdckldjjndioackbalphokd)
    
2. [Firefox](https://addons.mozilla.org/en-US/firefox/addon/selenium-ide/)
    
3. [Edge](https://microsoftedge.microsoft.com/addons/detail/selenium-ide/ajdpfmkffanmkhejnopjppegokpogffp)
    

Thank you for reading! Any constructive feedback is greatly appreciated!
