typestar

Web scraping

9 steps in 3 sets of Python.

Nine steps, two libraries, one honest warning. requests for getting the page, with sessions, headers, timeouts and the error handling people skip. BeautifulSoup for pulling things out of it: selectors, walking the tree, and the attribute access that gets you a link's href.

The Encore scrapes something end to end. Short tour, but the two libraries in it turn up constantly in scripts that were only ever supposed to run once.

Start this tour

requests

BeautifulSoup

Encore

The other Python tours