I want to get exact text without whitespace normalisation and trim using SwiftSoup library.
Currently, SwiftSoup provide element.text() method to extract text from that element.
But text()- Method gives trimmed and whitespace normalised text.
Any other way to get element text without trimmed and whitespace normalised?
This is not SwiftSoup specific but should be correct for the HTML DOM and is probably similar here:
https://www.w3schools.com/jsref/prop_node_innertext.asp
Not sure how to access the
textContentproperty with SwiftSoup (if that exists) but that's probably what you want.In case
.html()doesn't work for you.