def cleanhtml(raw_html): cleanr = re.compile(r'<(?!br).*?>') cleantext = cleanr.sub('', raw_html) return cleantext