Python web scraping simplified for beginners — Automate your workload with Selenium

Disclaimer

What is web scraping?

Terminology

Terminology (Bonus)

Installations

Is everything installed properly?

Are you new to Python?

Running an example project

Setup the essential folders:

Create a Selenium script:

Run the script:

How Selenium works

Step 1: Import webdriver

from selenium import webdriver

Step 2: Create a browser instance

driver = webdriver.Chrome("webdrivers/chromedriver")

Step 3: Define your actions

driver = webdriver.Chrome("webdrivers/chromedriver")
driver.get('https://google.com')
driver.find_element_by_css_selector(‘button’).click()

Methods that are run on the driver

driver = webdriver.Chrome("webdrivers/chromedriver")

Methods ran on a specific element

elem = driver.find_element_by_css_selector(‘a’)

Exporting Data

Finding the right CSS selectors

Scraping Challenge

The challenge:

Helpful guidelines for the challenge:

Possible answers

Script example #1:

Script example #2:

Script example #3 (Bonus):

python -V

Thanks for reading!

Writing about my experiences as a polymath in the startup world.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store