Formatting applications. I defended as best as possible, but my on-screen reader does not like SO formatters.
, . , , , .
, HTML Javascript , .
, Python xml DOM, W3C DOM .
PyV8 w3c.py dom DOM.
W3C Sample Dom
, . BeautifulSoup .
- lxml.etree target parser.
LXML Target Parser
" ".
HTML/ Script LXML, , , , DOM.
. ( , HTML , , ).
class domParser(object):
def __init__(self):
self.dom = newAwesomeCompliantDom()
self.document = self.dom.document
self.this = self.document
def comment(self, commentText):
self.this.appendChild(self.document.DOMImplementation.createComment(commentText))
def start(self, tag, attrs):
self.this = self.this.appendChild(self.document.DOMImplimentation.newElement(tag,attrs))
def data(self, dataText):
self.this.appendChild(self.document.DOMImpl.createDataNode(dataText))
def end(self):
self.this = self.this.parentNode
def close(self):
return self.document
x = lxml.etree.parse(target=domParser)
x.feed(htmlFile)
newDom = x.close()