from bs4 import BeautifulSoup
from typing import cast


def back_to_str(html: BeautifulSoup) -> str:
    """Retrieve content of the HTML body.
    Useful for converting back and forth between str and HTML (`BeautifulSoup`),
    so that in final concatenated HTML we don't end up with multiple <head>-s."""
    return cast(str, str(html.find("body")))