O'Reilly logo
live online training icon Live Online training

Programming with Python: Beyond the Basics

How to Write a Web Scraper in Python

Arianne Dee

This training is meant as a next step after Arianne’s Introduction to Python Programming Live Training course. In it, you will go beyond the basics and learn how to write useful programs in Python.

This is a hands-on course where you will build a web scraper in Python. It covers concepts like reading and writing to files, making HTTP requests, installing external libraries, and managing projects.

What you'll learn-and how you can apply it

  • How to read and write to CSV files
  • How to install libraries and make HTTP requests using the requests library
  • The basics of HTML and how to scrape a website

This training course is for you because...

  • You’re a novice Python developer who is ready to learn some intermediate concepts
  • You’re an intermediate/experienced developer who is new to Python
  • You’ve attended "Introduction to Python Programming" (live online training course) by Arianne Dee and want to learn more

Prerequisites

  • Some experience coding in Python 2 or 3
  • Basic understanding of the following concepts in Python: types, functions, conditionals, lists, while loops, and for loops

Course Set-up

Recommended Preparation

Recommended Follow-up

About your instructor

  • Arianne is a freelance software developer and educator from the University of British Columbia and an instructor for Canada Learning Code and MakerLabs in Vancouver, BC.

Schedule

The timeframes are only estimates and may vary according to how the class is progressing

Segment 1: Introduction and Set-up (50 min)

  • Installing Python and PyCharm
  • Reviewing Python Basics: conditionals, lists, and for loops
  • Dictionaries and exceptions

Q&A / Break (15 min)

Segment 2: Reading and Writing to Files (30 min)

  • Reading from files
  • Writing to files
  • CSV files

Segment 4: Making HTTP Requests (20 min)

  • Installing external libraries
  • Using the Requests library

Q&A / Break (15 min)

Segment 3: Scraping websites (40 min)

  • Introduction to HTML
  • Scraping data
  • Saving to a CSV file

Segment 4: Abstracting and Refactoring (10 min)

  • Cleaning up the code

Course wrap-up and next steps