come da titolo devo leggere il codice html di una pagina per poi fare un parse, la pagina non ha parametri da inviare esempio www.ivanomonti.eu carico e leggo html puro.
Chi mi rinfresca la memoria.
Chi mi rinfresca la memoria.
job3.Download("http://www.b4x.com/forum/images/categories/android.png")
job3.Download("http://www.ivanomonti.eu")
Activity.SetBackgroundImage(Job.GetBitmap)
dim stringa1 as string
stringa1=job.getstring
msgbox(stringa1,"")
Sub Activity_Create(FirstTime As Boolean)
Dim job3 As HttpJob
job3.Initialize("Job3", Me)
job3.Download("http://www.ivanomonti.eu")
End Sub
Sub JobDone (Job As HttpJob)
Log("JobName = " & Job.JobName & ", Success = " & Job.Success)
If Job.Success = True Then
Select Job.JobName
Case "Job3"
dim stringa1 asstring
stringa1=job.getstring
msgbox(stringa1,"")
End Select
Else
Log("Error: " & Job.ErrorMessage)
ToastMessageShow("Error: " & Job.ErrorMessage, True)
End If
Job.Release
End Sub
Sub request_Click
Try
hc.Initialize("hc")
Dim req As HttpRequest
req.InitializePost2(http://www.tuapagina.com, "".GetBytes("UTF8"))
hc.Execute(req, 1)
ProgressDialogShow("Attendi ultime estrazioni... ")
Catch
ToastMessageShow("Errore di Connessione...", True)
End Try
End Sub
Sub hc_ResponseSuccess (Response As HttpResponse, TaskId As Int)
ProgressDialogHide
Try
If File.Exists(File.DirRootExternal,"html.txt") = False Then
File.WriteString(File.DirRootExternal, "html.txt", "Numeber WinForLife by Ivano Monti")
End If
If Response <> Null Then
Response.GetAsynchronously("filtra",File.OpenOutput(File.DirRootExternal, "html.txt", False) , True, TaskId)
Else
ToastMessageShow ("Risposta dal server vuota", True)
End If
Catch
ToastMessageShow ("Errore non gestito.", True)
End Try
End Sub
Sub filtra_StreamFinish(Success As Boolean, TaskId As Int)
Dim html As String
html = File.GetText(File.DirRootExternal, "html.txt")
ToastMessageShow(html,True)
End Sub