get_text

get_text(path = nil)
Instance Public methods

Returns the first child Text node, if any, or nil otherwise. This method returns the actual Text node, rather than the String content.

doc = Document.new "<p>some text <b>this is bold!</b> more text</p>"
# The element 'p' has two text elements, "some text " and " more text".
doc.root.get_text.value            #-> "some text "
doc_ruby_on_rails
2015-05-06 10:44:16
Comments
Leave a Comment

Please login to continue.