Getting ready

We will demonstrate handling pagination with an example that crawls a set of pages from the website in the provided container.  This website models five pages with previous and next links on each page, along with some embedded data within each page that we will extract.

The first page of the set can be seen at http://localhost:5001/pagination/page1.html.  The following image shows this page open, and we are inspecting the Next button:

Inspecting the Next button

There are two parts of the page that are of interest. The first is the link for the Next button. It's a fairly common practice that this link has a class that identifies ...

Get Python Web Scraping Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.