You are viewing a single comment's thread. Return to all comments →
class MyHTMLParser(HTMLParser): def handle_data(self, data): if data != '\n': print(">>> Data\n"+ data) def handle_comment(self, data): data = data.split('\n') if len(data)>1: print('>>> Multi-line Comment\n'+'\n'.join(data)) else: print('>>> Single-line Comment\n'+ data[0])
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 →