Save to an xml file every 5mins and check for value

I have a url that seems to return me a XML file. I need to save it to a file so I can process it.

Then I need to check for a certain value for a element node every 5mins (quantity). Sometimes the node will be there, sometimes it will not. Is it possible to be done?
I need the item to be sold by only not 3rd party merchants
For some reason it returns -1

Open in new window

Who is Participating?
PaulHewsConnect With a Mentor Commented:
Using a timer...  I'm not sure it's necessary to save to a file, but I show how.  Also, how to extract a single node.
Imports System.Xml
Public Class Form1
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Timer1.Interval = 300000 ' 5min
        Timer1.Enabled = True
    End Sub
    Private Sub Timer1_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        Dim doc As New XmlDocument
        Dim nsMgr As New XmlNamespaceManager(doc.NameTable)
        nsMgr.AddNamespace("ns", "")
        doc.Save("C:\items.xml")  'Save file?
        Dim node As XmlNode = doc.DocumentElement.SelectSingleNode("//ns:Amount", nsMgr)
        If Not node Is Nothing Then
        End If
    End Sub
End Class

Open in new window

SharalynnAuthor Commented:
This is almost perfect! Thank you! But you said that there is no need to save it to a file and I see why... it kind of auto save the stuff into a object already upon retrieving from the link. But still, useful, thank you.
SharalynnAuthor Commented:
save http link to xml file
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.