title: Is there a way in VBA to get elements produced by javascript?
body: <p>I've been doing Google detective work for a few hours (including searching StackOverflow) for a technique to allow targeting of HTML elements produced by JavaScript in VBA.</p>
  
  <p>As an example, I <strong>cannot</strong> use ie.Document.getElementById(id) on this: <a href="http://www.kisfutures.com/electronic.html?page=quote&amp;sym=NGU12&amp;mode=i" rel="nofollow">http://www.kisfutures.com/electronic.html?page=quote&amp;sym=NGU12&amp;mode=i</a></p>
  
  <p>However, that method is quite capable of finding elements on static pages, as tested on google.com. </p>
  
  <p>I've played with simply getting all the InnerText from Document.body and then parsing the file for my desired TD values, but I ran into a roadblock when trying to split two values that are on different lines. As an illustration, the following was understood by Split(..) as "2040":</p>
  
  <pre><code>20
  40
  </code></pre>
  
  <p>From what I understand, the problem with getElementById(id) is that the website's table is generated by JavaScript after the page has loaded, and thus any elements created by that JavaScript cannot be targeted by my VBA code. Is there anyway to have my VBA code see this JavaScript-generated content?</p>
  
  <p>Thank you for your help!</p>
  
  <p><strong>Edit</strong></p>
  
  <p>The VBA code being used:</p>
  
  <pre><code>Function Quote(Market, Parameter)
      Set ie = CreateObject("InternetExplorer.Application")
      ie.Navigate "http://www.kisfutures.com/electronic.html?page=quote&amp;sym=NGU12&amp;mode=i"
      While ie.Busy
          DoEvents
      Wend
      Dim id As String
      id = "dt1_" &amp; Market &amp; "_" &amp; StrConv(Parameter, vbLowerCase)
      Quote = ie.Document.getElementByID(id).InnerText
      ie.Quit
  End Function
  </code></pre>
  
  <p>Basically I try to build an HTML element ID using the column header for the Market. So if, for example the market is "NGU12" and the column header is "Open", the ID built is: "dt1_NGU12_open", which is the ID for the TD element containing the "Open" value for market NGU12.</p>