ivanomonti Expert Licensed User Longtime User Aug 29, 2023 #1 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?
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 Aug 29, 2023 #2 ivanomonti said: 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? Click to expand... 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: Aug 29, 2023 Upvote 1
ivanomonti said: 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? Click to expand... 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
Erel B4X founder Staff member Licensed User Longtime User Aug 30, 2023 #3 Useful method for cross platform JavaScript injection: https://www.b4x.com/android/forum/threads/b4x-webview-ckeditor-rich-text-editor.133260/#content Upvote 0
Useful method for cross platform JavaScript injection: https://www.b4x.com/android/forum/threads/b4x-webview-ckeditor-rich-text-editor.133260/#content