title: How to get data from table on webpage
body: <p>I am trying to get data from the table under "full transaction log" but I am not sure how to get it. I tried to get the innertext of the table using ID but all I get are the headers. Can anyone guide me here please.</p>
  
  <p>This is the table I want to get data from: <a href="https://screenshots.firefox.com/VDJEsuPeQLIgRYWa/www.aastocks.com" rel="nofollow noreferrer">https://screenshots.firefox.com/VDJEsuPeQLIgRYWa/www.aastocks.com</a></p>
  
  <pre><code>Sub test()
  
      Dim oDom As Object: Set oDom = CreateObject("htmlFile")
      Dim x As Long, y As Long
      Dim oRow As Object, oCell As Object
      Dim data
  
      With CreateObject("msxml2.xmlhttp")
          .Open "GET", "http://www.aastocks.com/en/stocks/analysis/transaction.aspx?symbol=60001", False
          .Send
          oDom.body.innerHtml = .responseText
      End With
  
      Set t = oDom.getElementById("tradeLog1")
  
      Sheet1.Range("A1") = t.innertext
  '
  '    'loop through each row
  '    For Each r In t.Rows
  '        Debug.Print r.Cells(1).innertext
  '        'loop through each column in the row
  '        For Each c In r.Cells
  '            Debug.Print c.innertext
  '        Next
  '    Next
  
  End Sub
  </code></pre>