In lxml
's doc, it says:
lxml can interface to the parsing capabilities of BeautifulSoup through the lxml.html.soupparser module. It provides three main functions: fromstring() and parse() to parse a string or file using BeautifulSoup into an lxml.html document, and convert_tree() to convert an existing BeautifulSoup tree into a list of top-level Elements.
Meanwhile, BS
' can also use lxml
as the parser.[ref]
Beautiful Soup supports the HTML parser included in Python’s standard library, but it also supports a number of third-party Python parsers. One is the lxml parser.
BS
also suggests to use lxml
as the parser for speed.
So what if lxml
uses BS
for parsing when BS
's parser is lxml
conversely?
I have been scratching my head over understanding their relationship. Help.