Dealing with this website:
https://qrisk.org/three/
I need to run this calculator to compare it to my own calculator (using the provided algorithm).
I can set all the values in code and run the calculation with:
WVExtras1.executeJavascript(WebView1, strJavaScript)
However this appears slow and somewhat unreliable, do I thought a better way might be to download
the webpage source, alter it to set the values, load the http to a webview and then run the calculation, eg:
Setting the controls works fine, but the calculation can't run:
The web page at: file:///three/index.php could not be loaded because:
net::ERR_FILE_NOT_FOUND
Not sure what file this refers and how to fix this.
I am completely new to http and net stuff in general.
Not sure if downloading all the images (not many) and showing these in the webview
would make a difference.
Any idea how to tackle this?
Could I avoid loading to a webview and submitting the altered html directly?
RBS
https://qrisk.org/three/
I need to run this calculator to compare it to my own calculator (using the provided algorithm).
I can set all the values in code and run the calculation with:
WVExtras1.executeJavascript(WebView1, strJavaScript)
However this appears slow and somewhat unreliable, do I thought a better way might be to download
the webpage source, alter it to set the values, load the http to a webview and then run the calculation, eg:
B4X:
Sub TestWebPageDownLoad
Dim strHttp As String
Dim rs As ResumableSub = GetHttpFromURL(strQR3WebCalculator)
Wait For (rs) Complete (strHttp As String)
strHttp = strHttp.Replace($"<IMG width=100 border="0" src="clinriskLogoTransparent.png">"$, "") 'don't need this image
strHttp = strHttp.Replace("selected>non-smoker", ">non-smoker")
strHttp = strHttp.Replace(">moderate smoker (10 to 19)", "selected>moderate smoker (10 to 19)")
If pnlWebView.IsInitialized = False Then
Activity.LoadLayout("ShowWebView")
arrPanels(Enums.ePanelType.ShowWebview) = pnlWebView
End If
WebView1.LoadHtml(strHttp)
GotoPanel(Enums.ePanelType.ShowWebview, False, False)
'etc. etc.
End Sub
Sub GetHttpFromURL(strURL As String) As ResumableSub
Dim j As HttpJob
Dim strHttp As String
j.Initialize("", Me)
j.Download(strURL)
Wait For (j) JobDone(j As HttpJob)
If j.Success Then
strHttp = j.GetString
End If
j.Release
Return strHttp
End Sub
Setting the controls works fine, but the calculation can't run:
The web page at: file:///three/index.php could not be loaded because:
net::ERR_FILE_NOT_FOUND
Not sure what file this refers and how to fix this.
I am completely new to http and net stuff in general.
Not sure if downloading all the images (not many) and showing these in the webview
would make a difference.
Any idea how to tackle this?
Could I avoid loading to a webview and submitting the altered html directly?
RBS