Extracting the text contents of a node

From XPUB & Lens-Based wiki
Revision as of 13:59, 16 March 2011 by Aymeric Mansoux (talk | contribs) (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()))...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

The itertext method of a node can be useful.

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