I am trying to get the scripts in a webview.
The link is this: http://bbs.jiangnan.edu.cn/attachments/upload.php
I want to upload some image and get the returned value like "[pic xxxx.jpg]". The value is in the script.
So I use this code to get this:
But I failed to get the result.
The link is this: http://bbs.jiangnan.edu.cn/attachments/upload.php
I want to upload some image and get the returned value like "[pic xxxx.jpg]". The value is in the script.
So I use this code to get this:
B4X:
Sub uploadWV_PageFinished (Success As Boolean, Url As String)
Dim result As String
Dim no As NativeObject = uploadWV
result=no.RunMethod("stringByEvaluatingJavaScriptFromString:",Array("document.scripts[0]")).AsString
If result.Contains("pic") Then
Dim ubound As Int
Dim lbound As Int
ubound=result.IndexOf("[pic")
lbound=result.IndexOf("</script>")
result=result.SubString2(ubound,lbound)
End If
Log(result)
End Sub
But I failed to get the result.
Last edited: