Skip to main content

Section 14.1 Scrape all the Cottage Inn Pizza locations

Let’s say that you want to make a list of all the Cottage Inn Pizza locations. When you go to their website, it turns out that there are a lot of locations.
Figure 14.1.1. Scrolling around the Cottage Inn locations page to see that there are a lot of locations
If only you could write a little Python to easily collect them all...
It turns out that you can! Run the code below to see what it collects.

Activity 14.1.1.

This code probably seems a bit complicated. In this ebook, we will break down web scraping into a few common "plans". This example is made up of three plans. Click on each of them to learn more.
Plan 2: Get a soup from a URL plan2.html
Plan 5: Get info from all tags of a certain type plan5.html
Plan 9: Print the info plan9.html
You have attempted of activities on this page.