
import html5lib
# Recursion sur les Nodes Html
def _recurse(node):
    for node in node.childNodes:
        for node in node.childNodes:
            if  len(node.childNodes):
                _recurse(node)
            else:
              print node.__dict__
             

f = open("Bookmarks_parser.html")
parser = html5lib.HTMLParser()
doc = parser.parse(f)
_recurse(doc  ,)






##import html5lib
### Recursion sur les Nodes Html
##def printTree(node , indent =0):
##    tree = ''
##    for node in node.childNodes:
##          tree += node.toxml()
##    open("Bookmarks_parser_printed.html", "wb").write(
##        tree.encode("utf-8"))
##       
##
##             
##
##f = open("Bookmarks_parser.html")
##parser = html5lib.HTMLParser()
##doc = parser.parse(f)
##printTree(doc  ,)

