title: How do I extract an entire table that contain scroll down in page
body: <p>Why when I'm extracting the table using the method .getElementsByTagName it doesn't extract all data contained in table? Note that is a scroll down in page <a href="https://finance.yahoo.com/quote/MGLU3.SA/history?p=MGLU3.SA" rel="nofollow noreferrer">https://finance.yahoo.com/quote/MGLU3.SA/history?p=MGLU3.SA</a>. </p>
  
  <pre><code>Public Sub getHistoricCotation()
  
      Dim mainURL As String
      Dim elem As Object, tRow As Object
      Dim S, R, C
      Dim initial_date As String, final_date As String
      Dim stock As String
  
      initial_date = DateDiff("s", "1/1/1970 00:00:00", ufHistorico.txtDtInicial) + 86400
      final_date = DateDiff("s", "1/1/1970 00:00:00", ufHistorico.txtDtFinal) + 86400
      stock = ufHistorico.cbAcoes.Text
  
      mainURL = "https://finance.yahoo.com/quote/" &amp; stock &amp; "/history?period1=" &amp; initial_date &amp; "&amp;period2=" &amp; final_date &amp; "&amp;interval=1d&amp;filter=history&amp;frequency=1d"
  
      With CreateObject("WinHttp.WinHttpRequest.5.1")
          .Open "GET", mainURL, False
  
          strCookie = .getAllResponseHeaders
          strCookie = Split(Split(strCookie, "Cookie:")(1), ";")(0)
  
          .Open "GET", mainURL, False
          .setRequestHeader "Cookie", strCookie
          .setRequestHeader "User-Agent", "Mozilla/5.0 (Windows NT 6.1; ) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.97 Safari/537.36"
          .send
  
          S = .responseText
      End With
  
      With CreateObject("htmlfile")
          .body.innerHTML = S
          For Each elem In .getElementsByTagName("tr")
              For Each tRow In elem.Cells
                  C = C + 1: Cells(R + 1, C) = tRow.innerText
              Next tRow
              C = 0: R = R + 1
          Next elem
      End With
  
  End Sub
  </code></pre>