Reading TEXT UIWebView Content

I am interested in reading ONLY the contents of TEXT in a UIWebView. How can I do it? I found a lot of help on the web about reading HTML content, but I want ONLY text. Any suggestions?

thanks

+4
source share
1 answer

Get the .textContent or .innerText root node instead of .innerHTML .

 [web stringByEvaluatingJavaScriptFromString:@"document.documentElement.innerText;"]; 

(BTW, there is also a private property of webView.text .)

+13
source

Source: https://habr.com/ru/post/1306857/


All Articles