class MLStripper(HTMLParser):

    def __init__(self):
        self.reset()
self.fed = []

def handle_data(self, d):
    self.fed.append(d)

def get_data(self):
    return ''.join(self.fed)

def strip_tags(html):
    s = MLStripper()
s.feed(html)
return s.get_data()
How can I convert HTML into text without markup in Python?