Getting ready

We will use a small web site that is included in the www folder of the sample code.  To follow along, start a web server from within the www folder.  This can be done with Python 3 as follows:

www $ python3 -m http.server 8080Serving HTTP on 0.0.0.0 port 8080 (http://0.0.0.0:8080/) ...

The DOM of a web page can be examined in Chrome by right-clicking the page and selecting Inspect. This opens the Chrome Developer Tools. Open a browser page to http://localhost:8080/planets.html. Within chrome you can right click and select 'inspect' to open developer tools (other browsers have similar tools).

Selecting Inspect on the Page

This ...

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.