I have the following html parser:
from HTMLParser import HTMLParser
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()
I would like to use this on the following data.frame:
df = pd.DataFrame([['<br> test </br>', 1]], columns=('body', 'ticketID'))
My assumption would be that it would work like this:
for row in df.iterrows():
input = row['body']
print(strip_tags(input)
But this gives me a type error. Any thoughts where this goes wrong?