There's more...

We are providing a dictionary to the build_2grams() function that defines rules for identifying 2-grams.  In this example, we predefined these 2-grams.  It is possible to use NLTK to find 2-grams (and n-grams in general), but with this small sample of one job positing, it's likely that none will be found.

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.