You are viewing a single comment's thread. Return to all comments →
class MyHTMLParser(HTMLParser): def handle_comment(self, comment): if '\n' in comment: print('>>> Multi-line Comment') else: print('>>> Single-line Comment') print(comment) def handle_data(self, data): if data == '\n' : return print('>>> Data') print(data)
Seems like cookies are disabled on this browser, please enable them to open this website
HTML Parser - Part 2
You are viewing a single comment's thread. Return to all comments →
Easiest Solution: