B4J Question Extract data from Webview

MicroDrie

Well-Known Member
Licensed User
Longtime User
You can extract the HTML string from a web site with the following code:

B4X:
Sub AppStart (Form1 As Form, Args() As String)
    MainForm = Form1
    'MainForm.RootPane.LoadLayout("Layout1") 'Load the layout file.
    
'    --- Needs the jOkHttpUtils2
    Dim j As HttpJob
    j.Initialize("", Me)
    j.Download("https://www.google.com")
    Wait For (j) JobDone(j As HttpJob)
    If j.Success Then
        Log(j.GetString)
    End If
    j.Release
End Sub

Depending on what you want to do a possibility is to use jSoup HTML Parser to parse the HTML string. Other inspiration can be found here
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…