On 3 Apr, 06:59, Benjamin <[EMAIL PROTECTED]> wrote: > I'm trying to parse an HTML file. I want to retrieve all of the text > inside a certain tag that I find with XPath. The DOM seems to make > this available with the innerHTML element, but I haven't found a way > to do it in Python.
With libxml2dom you'd do the following: 1. Parse the file using libxml2dom.parse with html set to a true value. 2. Use the xpath method on the document to select the desired element. 3. Use the toString method on the element to get the text of the element (including start and end tags), or the textContent property to get the text between the tags. See the Package Index page for more details: http://www.python.org/pypi/libxml2dom Paul -- http://mail.python.org/mailman/listinfo/python-list