from bs4 import BeautifulSoup


def clean_html(html): 
    """Given the html of a huffpost webpage, grab the text body of the article and return 
    it as a string."""
    soup = BeautifulSoup(html, "html.parser")
    
    #in HuffPost articles, any div with the class ="primary-cli cli cli-text"   
    #contains a portion of the article body. 
    content = soup.find_all("div", 
                        {"class": "primary-cli cli cli-text"})

    text = " ".join([child.get_text() for child in content])

    #remove any extra newline characters
    text = text.translate(text.maketrans("\n\t\r", "   "))
    return text