There are many ways to obtain online data, although the most simple is to use the System.Net namespace. This is an area I am learning at the moment, and can only offer a fairly simple solution.
Private Sub GetPageData()
Try
Dim request As WebRequest = WebRequest.Create("Your Web page here")
request.Credentials = CredentialCache.DefaultCredentials
Dim response As HttpWebResponse = CType(request.GetResponse(), HttpWebResponse)
MsgBox(response.StatusDescription)
Dim dataStream As System.IO.Stream = _
response.GetResponseStream()
Dim reader As New System.IO.StreamReader(dataStream)
Dim responseFromServer As String = reader.ReadToEnd()
If responseFromServer <> "" Then
TextBox1.Text = responseFromServer
Else
TextBox1.Text = "There is no downloadable data to view"
End If
Catch ex As Net.WebException
TextBox1.Text = ex.Message() & " " & ex.Source
Catch ex As Exception
TextBox1.Text = ex.Message() & " " & ex.Source
End Try
End Sub
Once you have the data in an input stream, you then have to check the document for the values you need; a simple example is to iterate over the document using a TextReader to find the ids or names of the tags. Depending on what you want from the data, you just then have to insert the page or values into the database the ordinary way.
Enter your message below
Sign in or Join us (it's free).