from html.entities import name2codepoint

def unescape(s):
    for name in name2codepoint:
        s = s.replace('&%s;' % name, chr(name2codepoint[name]))
return s
How to unescape special characters from BeautifulSoup output?