title: Using Excel VBA code to send a POST and retrieve data
body: <p>What VBA code would allow me to send a POST request (in a asp search box) and then  to retrieve data between a <code>&lt;span id="xxx"&gt;&lt;/span&gt;</code> tag? (in the resulting page)</p>
  
  <p>I have the following code that simulates a search request in the page:</p>
  
  <pre><code> Dim Site As Object
   Set Site = CreateObject("InternetExplorer.application")
   Dim QNUMBER As String
   Dim URL As String
  
   URL = "apps/inventory/Default.aspx" 'local website
   QNUMBER = textBox_Scan.Text
   Site.navigate URL
   While Site.busy
   Wend
   Dim oHTMLDoc As Object
   Set oHTMLDoc = Site.document
  
   oHTMLDoc.getElementById("input_search").Value = QNUMBER
   oHTMLDoc.getElementById("btn_search").Click
  </code></pre>
  
  <p>It doesnt feel "clean" to do it that way and I feel that sending a POST request would be more appropriate.</p>
  
  <p>Thanks.</p>
  
  <p>[edit]</p>
  
  <p>This is the form code</p>
  
  <pre><code> &lt;form name="aspnetForm" method="post" action="Default.aspx" id="aspnetForm"&gt;
  </code></pre>
  
  <p>The input text id</p>
  
  <pre><code>id="input_search" 
  </code></pre>
  
  <p>The submit button code</p>
  
  <pre><code>id="btn_search"
  </code></pre>
  
  <p>and I'd like to get data from <code>&lt;span id="warranty"&gt;36 month&lt;/span&gt;</code> and <code>&lt;span id="budget"&gt;500$&lt;/span&gt;</code></p>