[Htmlparser-user] running StringBean on Node
Brought to you by:
derrickoswald
From: Jeffrey B. <jb...@cs...> - 2007-01-07 07:33:39
|
Hi, I'd like to be able to run StringBean on a given Node and have it give me all the text from that Node and from its descendants on down the DOM tree. I can do something similar on the whole page by using a Parser to first get a NodeList of all of the nodes in the tree and then run the following: StringExtractor sb = new StringExtractor(); all_nodes.visitAllNodesWith(sb); Is there a way to either get all of the descendants of a given Node or to otherwise get just the text from all the descendants of a given Node? Worst case, I can write my own recursive function that will gather up all the Nodes and their children and their descendants - I'm just thinking that there is probably an existing way to do this. Thanks! Jeff |