Getting started with Selenium

Gburgos
1 min readApr 20, 2021

For my image classification project I used Selenium to help scrape images online. I enjoyed using Selenium since it is a powerful tool which will allow you to view how your code executes when scrapping.

To get started you can run terminal and insert the following command:

pip install selenium

After Selenium installs you have to also download a driver for Selenium to operate. Examples of drivers can be found in the Selenium documentation. Here is the link for your reference.

No matter what driver you decide to use here are a few things to keep in mind….

Ensure to always provide the correct path to the driver’s location. For example here is how a driver location will look for Chrome:

webdriver.Chrome(r”C:\Users\gburg\Desktop\Scrape\chromedriver.exe”)

Insert the letter “r” in the beginning of your path string if your facing errors. The “r” character makes your path a raw string, it enables all special characters to be taken into a literal account. Also remember to provide a “.exe” at the end of your driver file.

Lastly, keep in mind that there needs to be a internet connection for Selenium to execute.

If interested here is a great video to learn how to use Selenium. Shout out to Christopher Zita for an awesome demonstration.

--

--