开发者

Reading UIWebView TEXT content

开发者 https://www.devze.com 2022-12-27 06:56 出处:网络
I am interested in reading ONLY开发者_运维问答 the TEXT content of a UIWebView.How do I do this?I found lots of help on the web about reading the HTML content but I want ONLY the Text.Any suggestions?

I am interested in reading ONLY开发者_运维问答 the TEXT content of a UIWebView. How do I do this? I found lots of help on the web about reading the HTML content but I want ONLY the Text. Any suggestions?

Thanks


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

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

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

0

精彩评论

暂无评论...
验证码 换一张
取 消