Skip to content

Latest commit

 

History

History
111 lines (83 loc) · 2.37 KB

Install Selenium & Chromedriver on your System.md

File metadata and controls

111 lines (83 loc) · 2.37 KB

Setup Selenium & Chromedriver on your System

There are many ways to use chromedriver & selenium. Here are the ways we do it in this guide:

  • Google Colab
  • Deepnote
  • macOS
  • Linux (debian systems)
  • Windows (coming soon)
  • Docker

Google Colab

Go to this link. It uses the notebook saved here.

Deepnote

Much like Google Colab, you can use Deepnote.com to run this setup. Click this link to launch it. It uses the notebook saved here.

macOS

1. Install chromedriver via homebrew formulae

brew install --cask chromedriver

2. Create and activate a virtual environment

cd path/to/your/project
python3 -m venv .
source bin/activate

3. Install Selenium

pip install selenium

You can use path/to/your/project/bin/pip install selenium as well

Linux (debian)

1. Install chromedriver via apt

sudo apt-get update
sudo apt-get install -y \
    build-essential \
    python3-dev \
    python3-setuptools \
    chromium-driver

2. Create and activate a virtual environment

cd path/to/your/project
python3 -m venv .
source bin/activate

3. Install Selenium

pip install selenium

You can use path/to/your/project/bin/pip install selenium as well

Windows (coming soon)

Using Docker

pre-built

FROM codingforentrepreneurs/python:3.9-webapp-selenium

manually

FROM python:3.9-slim

RUN apt-get update && \
    apt-get install -y \
    build-essential \
    python3-dev \
    python3-setuptools \
    git \
    git-crypt \
    unzip \
    chromium-driver \
    gcc \
    make

RUN python -m pip install selenium

# Create a virtual environment in /opt
RUN python3 -m venv /opt/venv && /opt/venv/bin/python -m pip install selenium

RUN apt-get autoremove -y \
    && rm -rf /var/lib/apt/lists/*