Migrate from html5lib to BeautifulSoup