B4J Question read webview content

ivanomonti

Expert
Licensed User
Longtime User
Hello everyone, I need to read the html content in a page loaded on webview, can you tell me how can I get this result?
 

Mariano Ismael Castro

Active Member
Licensed User
Hello everyone, I need to read the html content in a page loaded on webview, can you tell me how can I get this result?
check this thread
https://www.b4x.com/android/forum/threads/how-to-get-the-html-code-of-a-webview-object.47207/

Read webview content:
Private Sub WebView1_PageFinished (Url As String)
    Dim joWV As JavaObject = WebView1
    Dim res As String = joWV.RunMethodJO("getEngine", Null).RunMethod("executeScript", Array("document.getElementsByTagName('html')[0].innerHTML"))
    Log(res)
End Sub
 
Last edited:
Upvote 1
Cookies are required to use this site. You must accept them to continue using the site. Learn more…