Summary
In this chapter, we learned the different objects in the Beautiful Soup module. We understood how the HTML/XML document is converted to a BeautifulSoup
object with the help of underlying TreeBuilders
. We also had a look at the creation of BeautifulSoup
by passing a string and a file object (for a local file and URL). Creating BeautifulSoup
for XML parsing and the use of the features
argument in the constructor were also explained. We saw how the different tags and texts within the HTML/XML document are represented as a Tag
and NavigableString
object in Beautiful Soup.
In the next chapter, we will learn the different searching methods, such as find()
, find_all()
, and find_next()
, provided by Beautiful Soup. With the help of these searching methods, we will be able to get data out of the HTML/XML document, which is indeed the most powerful feature of Beautiful Soup.