title: Parse XML error in VBScript
body: <p>I have this simple <code>VBScript</code> that sends an <code>HTTP POST</code> request and reads the returning <code>HTML</code> response.</p>
  
  <pre><code>Function httpPOST(url, body, username, password )  
    Set Http = CreateObject("Msxml2.ServerXMLHTTP")   
    Http.Open "POST", url, False, username, password  
    Http.setRequestHeader _  
                "Content-Type", _  
                "application/x-www-form-urlencoded"  
    Http.send body 
    pagestatus = Http.status
    if pagestatus&lt;&gt; "200" then
      httpPOST="Error:"&amp; pagestatus
    else
      'httpPOST = Http.ResponseBody
      'httpPOST = Http.responseText
      Set objXMLDoc = CreateObject("MSXML.DOMDocument")
      objXMLDoc.async = False
      objXMLDoc.validateOnParse = False
      objXMLDoc.load(Http.ResponseBody)
      Set objNode = objXMLDoc.selectSingleNode("/html/body/center/img")
      httpPost = objNode.getAttribute("alt") 
    end if
  End Function
  </code></pre>
  
  <p>The <code>HTML</code> response format is the following:</p>
  
  <pre><code>&lt;html&gt;
      &lt;head&gt;
          &lt;meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /&gt;
          &lt;title&gt;---&lt;/title&gt;
      &lt;/head&gt;
      &lt;body&gt;
          &lt;center&gt;
              &lt;img alt="You are now connected" src="pages/GEN/connected_gen.png"&gt;
          &lt;/center&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>The issue with this script is that it always returns <code>Error: Object required: 'objNode'</code></p>
  
  <p>I have tried so many variations of <code>XML</code> parsers, and finally gave up for every time I got the same error related to <code>XML</code> objects.</p>