Beispiel #1
0
 def handle_startendtag(self, tag, attrs):
     ''' 处理自闭标签 '''
     HTMLParser.handle_startendtag(self, tag, attrs)
     print(HTMLParser.get_starttag_text(self))
Beispiel #2
0
 def handle_starttag(self, tag, attrs):
     ''' 处理起始标签 '''
     HTMLParser.handle_starttag(self, tag, attrs)
     if not HTMLParser.get_starttag_text(self).endswith('/>'):
         print('<',tag,'>')
Beispiel #3
0
 def handle_endtag(self, tag):
     ''' 处理结束标签 '''
     HTMLParser.handle_endtag(self, tag)
     if not HTMLParser.get_starttag_text(self).endswith('/>'):
         print('</',tag,'>')
Beispiel #4
0
 def handle_endtag(self, tag):
     """处理结束标签"""
     HTMLParser.handle_endtag(self, tag)
     if not HTMLParser.get_starttag_text(self).endswith("/>"):
         print "</", tag, ">"
Beispiel #5
0
 def handle_startendtag(self, tag, attrs):
     """处理自闭标签"""
     HTMLParser.handle_startendtag(self, tag, attrs)
     print HTMLParser.get_starttag_text(self)
Beispiel #6
0
 def handle_starttag(self, tag, attrs):
     """处理起始标签"""
     HTMLParser.handle_starttag(self, tag, attrs)
     if not HTMLParser.get_starttag_text(self).endswith("/>"):
         print "<", tag, ">"
Beispiel #7
0
 def handle_startendtag(self, tag, attrs):
     """处理自闭标签"""
     HTMLParser.handle_startendtag(self, tag, attrs)
     print HTMLParser.get_starttag_text(self)
Beispiel #8
0
 def handle_endtag(self, tag):
     """处理结束标签"""
     HTMLParser.handle_endtag(self, tag)
     if not HTMLParser.get_starttag_text(self).endswith("/>"):
         print "</",tag,">"
Beispiel #9
0
 def handle_starttag(self, tag, attrs):
     """处理起始标签"""
     HTMLParser.handle_starttag(self, tag, attrs)
     if not HTMLParser.get_starttag_text(self).endswith("/>"):
         print "<",tag,">"
Beispiel #10
0
 def get_starttag_text(self):
     return HTMLParser.get_starttag_text(self)