title: VBA Getting results in another url but same window
body: <p>I'm working with VBA to fill a form in a URL and submiting to get results.
  When I submit the form with correct values and submit via VBA, I get results in another URL but on the same window.</p>
  
  <p>The problem is that I don't know how to change html reference to start scrapping data with this new url.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>    'to refer to the running copy of Internet Explorer
      Dim IE As InternetExplorer
      'to refer to the HTML document returned
      Dim html As HTMLDocument
      'open Internet Explorer in memory, and go to website
      Set IE = New InternetExplorer
      IE.Visible = False
      IE.navigate "http://url..."
      'Wait until IE is done loading page
      Do While IE.READYSTATE &lt;&gt; READYSTATE_COMPLETE
          Application.StatusBar = "Connecting with http://url..."
          DoEvents
      Loop
      'show text of HTML document returned
      Set html = IE.document
      'close down IE and reset status bar
      Set IE = Nothing
      Application.StatusBar = ""
  
      Set txtArea = html.getElementsByTagName("textarea")(0)
      txtArea.Value = txtArea_data
  
      Set formSubmit = html.getElementsByName("submit")(1)
      formSubmit.Click
  
      '-------------Get results
  'Dim html_results As HTMLDocument
  IE.navigate "http://new_url" 'Im not sure if I must do it this way...
  'Wait until IE is done loading page
  Do While IE.READYSTATE &lt;&gt; READYSTATE_COMPLETE
      Application.StatusBar = "Connecting with http://new_url..."
      DoEvents
  Loop
  Set html = IE.document
  Dim trResults As IHTMLElementCollection
  Set trResults = html.getElementsByClassName("tr")
  MsgBox (trResults.Length) 'At this point, trResults always have 0 results...
  </code></pre>
  
  <p>Have you any idea to help me?</p>
  
  <p>Thanks!</p>