示例#1
0
'''
Current driver simple HTMl processor.
which builds DOM tree.
'''
from MyHTMLParser import MyHTMLParser

mockData = "<html><head><title>This is the</title></head><body><h1>This<br /><>is the <span>header</span></h1></body></html>"

cursor = MyHTMLParser()
cursor.feed(mockData) #builds tree

cursor.printTree()	#prints tree!	

def findElementsByClass(className):
	return cursor.findElementsByClass(className)