Member-only story
How to install Selenium and run it successfully via Jupyter Lab
1 min readApr 9, 2020
Only 4 steps
- 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!