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 ...
Get Getting Started with Beautiful Soup 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.