using beautifulsoup with html5lib, it puts the html, head and body tags automatically:
BeautifulSoup(\'FOO\', \'html5lib\') # => <
Your only option is to not use html5lib to parse the data.
html5lib
That's a feature of the html5lib library, it fixes HTML that is lacking, such as adding back in missing required elements.