iOS Question Read body elements from Webview

sergiones

Member
Licensed User
Longtime User
Hi guys, I need to read all the body elements from a webview like <p> and <span>.

How can I do it?

Thank you
 

sergiones

Member
Licensed User
Longtime User
I solved the problem using:

Dim no As NativeObject = WebView1
Dim myString As String = no.RunMethod("stringByEvaluatingJavaScriptFromString:", Array("document.body.innerText")).AsString

In this case I got the innerText because I actually need the strings. If you need the html tags you can use document.body.innerHtml

Thank you.
 
Upvote 0
Top