Couldn't find a tree builder with the features you requested: lxml. Do you need to install a parser library?
soup = BeautifulSoup(s, "html.parser")
soup = BeautifulSoup(html, "html5lib")
pip3 install lxml
soup = BeautifulSoup(html, features="xml")