Doug Bales has asked for the wisdom of the Perl Monks concerning the following question:
Hi all,
I am new to HTML::TreeBuilder.
I know you can use $tree->as_text to obtain a string consisting of all the text nodes from this element and its children.
My question is: Is there an easy way to obtain a string of just the text at this node and not its children?
Thanks,
Doug
Use the $tree->content_list method and concatenate all the non-element nodes, so get just the text for this element. The full list of methods can be seen in the documentation for HTML::Element.