[Tutor] ElementTree, TidyHTMLTreeBuilder, find

Bob Tanner tanner at real-time.com
Wed Dec 14 07:32:05 CET 2005


Having problem understanding how find() works.

The html file I'm using is attached.

Python 2.4.2 (No.2, Nov 20 2005, 17:04:48) 
>>> from elementtidy import TidyHTMLTreeBuilder
>>> doc = TidyHTMLTreeBuilder.parse('048229.html')
>>> root = doc.getroot()
>>> print root.find('html/body')
None
>>> print root.find('body')
None
>>> 

Viewing the html under firefox DOM tool

-#document
  -HTML
    +HEAD
        #TEXT
    +BODY

No sure how to use the find.
-- 
Bob Tanner <tanner at real-time.com>          | Phone : (952)943-8700
http://www.real-time.com, Minnesota, Linux | Fax   : (952)943-8500
Key fingerprint = AB15 0BDF BCDE 4369 5B42  1973 7CF1 A709 2CC1 B288
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20051214/42288ace/048229.html


More information about the Tutor mailing list