Hi,
and welcome to this module where we'll use Beautiful Soup to
search for elements in the parse tree.
Now we've seen in a previous module that Beautiful Soup sets up
an HTML parse tree that you can then navigate.
In this module,
we'll see how you can search for specific elements in
the tree using advanced functionality.
We'll continue using the find and find_all functions,
but we'll add an additional input argument,
such as the limit argument or the recursive argument.
We'll also see how we can search specifically for parents,
descendants, siblings, and next and previous elements.
In addition to parsing and working with HTML documents,
Beautiful Soup and the lxml parser can be used with XML documents as well.
We'll first understand what XML is and understand the
differences and similarities between XML and HTML.
We'll also see a demo where we'll find page elements using XPath,
and we'll also see how we can use CSS selectors
with Soup Sieve in Beautiful Soup.
I use the term selector here rather loosely.
It's a specification of what HTML elements are to be
selected for further processing.
And in Beautiful Soup,
you can use CSS selectors using the Soup Sieve Python library that is
installed by default when you install Beautiful Soup.