for e in tag.findAll(True):
    for attribute in e.attrs:
        if attribute[0] not in whitelist:
            del e[attribute[0]]
return tag
clean(soup, ['title', 'href'])
Remove all inline styles using BeautifulSoup