Hi All,
Have a program I am working on which grabs a web page and parses the values.
Work fine in debug but not release.
Any ideas..
Have a program I am working on which grabs a web page and parses the values.
Work fine in debug but not release.
Any ideas..
B4X:
Sub Handle(req As ServletRequest, resp As ServletResponse)
mreq = req
mresp = resp
Dim params As Map = req.ParameterMap
Dim values() As String = params.Get("pageurl")
For Each value As String In values
Dim url As String = value
' Log(url)
Downloadcode("0",url,"temp.html")
' Parse_Web("temp.html",url)
Next
resp.SendRedirect("homes.html")
End Sub
Sub Downloadcode(Id, Link As String, filename As String)
Try
Dim job As HttpJob
job.Initialize("", Me) 'note that the name parameter is no longer needed.
job.Download(Link)
Wait For (job) JobDone(job As HttpJob)
If job.Success Then
Dim out As OutputStream = File.OpenOutput(File.DirApp & "/homes", filename, False)
File.Copy2(job.GetInputStream, out)
out.Close
' Log("downloaded " & Id)
Parse_Web(filename,Link)
Else
Log("oops " & Id)
Dim WhereFields As Map
WhereFields.Initialize
WhereFields.Put("id", Id)
' DBUtils.DeleteRecord(SQLite,"homes",WhereFields)
End If
job.Release
Catch
Log("er: " & LastException)
End Try
End Sub