Chapter 3. Search Using Beautiful Soup

We saw the creation of the BeautifulSoup object and other objects, such as Tag and NavigableString in Chapter 2, Creating a BeautifulSoup Object. The HTML/XML document is converted to these objects for the ease of searching and navigating within the document.

In this chapter, we will learn the different searching methods provided by Beautiful Soup to search based on tag name, attribute values of tag, text within the document, regular expression, and so on. At the end, we will make use of these searching methods to scrape data from an online web page.

Searching in Beautiful Soup

Beautiful Soup helps in scraping information from web pages. Useful information is scattered across web pages as text or attribute values ...

Get Getting Started with Beautiful Soup now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.