from BeautifulSoup import BeautifulSoup
html_decoded_string = BeautifulSoup(html_encoded_string, convertEntities=
    BeautifulSoup.HTML_ENTITIES)
How can I use Python to replace HTML escape characters?