Possible Duplicate:
Equivalent to InnerHTML when using lxml.html to parse HTML
What is the equivalent of innerHTLML for cssselect using lxml.html with python 2.7?
import lxml.html, cssselect
doc = lxml.html.document_fromstring(htmldocstring)
e = doc.cssselect('div.mainl')[0]
print e.innerHTML #This doesn't work
How do I get the inner/outer html of e?
Outer html To get the outer html you do:
print lxml.html.tostring(e)
Still don't know how to get innerHTML.