Benjamin 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.

    import lxml.html as h
    tree = h.parse("somefile.html")
    text = tree.xpath("string( some/[EMAIL PROTECTED] )")

http://codespeak.net/lxml

Stefan
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to