Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Tree: 7dfbb468ea
Fetching contributors…

Cannot retrieve contributors at this time

29 lines (18 sloc) 0.524 kB
#!/usr/bin/python
#
# Copyright 2011 Google Inc. All Rights Reserved.
"""HTMLStripper based on HTMLParser."""
__author__ = 'wclarkso@google.com (Will Clarkson)'
import HTMLParser
class HTMLStripper(HTMLParser.HTMLParser):
"""Simple class to strip tags from HTML."""
def __init__(self):
HTMLParser.HTMLParser.__init__(self)
self.reset()
self.fed = []
def handle_data(self, d):
self.fed.append(d)
def GetFedData(self):
return ''.join(self.fed)
def ClearFedData(self):
self.fed = []
Jump to Line
Something went wrong with that request. Please try again.