Member-only story

How to install Selenium and run it successfully via Jupyter Lab

Shan Yi Tan
1 min readApr 9, 2020

--

Only 4 steps

  1. Open your Jupyter Lab and run the code below.
!pip install selenium

2. Download the zipped file of WebDriver here. Choose the one based on the browser that you are using.

3. Extract the downloaded file and copy-paste the .exe file to your PATH.

4. Don’t know where’s your PATH? Run the code on Jupyter Lab to get it and paste the file into the directory you just found out.

import os
import sys
os.path.dirname(sys.executable)

5. After you paste your file into the PATH, test whether it works using code below.

from time import sleep
from selenium import webdriver
# this is tested on Firefox or you can use "webdriver.Chrome()"
browser = webdriver.Firefox()
browser.get(‘https://www.facebook.com/')sleep(5)browser.close()

7. If you see the Firefox browser opens facebook.com and closes it after 5 seconds. Then the installation is done!

--

--

Shan Yi Tan
Shan Yi Tan

Written by Shan Yi Tan

A fintech product manager who runs creative projects and business after 9-5 | More manifestation and productivity at http://wondefull.com/

Responses (2)