Extracting the text contents of a node: Difference between revisions

From XPUB & Lens-Based wiki
(Created page with "The itertext method of a node can be useful. <source lang="python"> for t in node.itertext(): print t </source> <source lang="python"> text = "".join(list(node.itertext()))...")
 
(No difference)

Latest revision as of 13:59, 16 March 2011

The itertext method of a node can be useful.

for t in node.itertext():
    print t
text = "".join(list(node.itertext()))