title: VBA: Html response to DOMDocument
body: <p>I'm trying to automaticly parse a website (eg. <a href="http://www.delhaizedirect.be/nl/Search/Duvel" rel="nofollow">http://www.delhaizedirect.be/nl/Search/Duvel</a> and get the price of the first item in the list in VBA. Therefore, I'm getting the HTML, which works fine. But when I parse the HTML into a DOMDocument and apply an XPath query, I don't get any result. </p>
  
  <p>This is the code I'm using:</p>
  
  <pre><code>Public Function zoekDelhaizePrijs(Artikel As String)
  
  Dim URL As String
  URL = "http://www.delhaizedirect.be/nl/Search/" + Artikel
  
  Dim website As Object
  Set website = CreateObject("MSXML2.ServerXMLHTTP.6.0")
  
  Call website.Open("GET", URL, False)
  Call website.Send("")
  
  Dim XPathQuery As String
  XPathQuery = "/html/body/div[1]/div[3]/div[1]/div[1]/div[3]/ul/div[1]/div/div[2]/p[1]"
  
  Dim dom As DOMDocument60
  Set dom = New DOMDocument60
  dom.async = False
  
  dom.validateOnParse = False
  
  'Debug.Print website.responseText
  
  dom.LoadXML website.responseText
  dom.setProperty "SelectionLanguage", "XPath"
  
  Dim node As IXMLDOMNodeList
  Set node = dom.SelectNodes(XPathQuery)
  
  Dim title As IXMLDOMNode
  
  For Each title In node
      Debug.Print title.Text
  Next
  
  End Function
  </code></pre>
  
  <p>Does anyone have any idea?</p>
  
  <p>Thanks in advance,
  Tom</p>