title: VBA to copy website data
body: <p>Can someone help to point me in a right direction on how to copy a particular data from a website to excel sheet via VBA?</p>
  
  <p>I tried using macro recorder and web query but it keeps showing error script and the yellow arrow didn't show up at the part that i want to copy.</p>
  
  <p>This is the website that i'm trying to copy <a href="http://etfdb.com/etf/EEM/#holdings" rel="nofollow">http://etfdb.com/etf/EEM/#holdings</a></p>
  
  <p>I only want to copy the Top Ten Holdings part.</p>
  
  <p>Any help would be greatly appreciated. Thank you in advance.</p>
  
  <p>Edit : This is my current code but nothing showed up, can someone tell me whats wrong?</p>
  
  <pre><code>Sub Get123()
  
  Dim oHtml       As HTMLDocument
  Dim oElement    As Object
  
  Set oHtml = New HTMLDocument
  
  With CreateObject("WINHTTP.WinHTTPRequest.5.1")
      .Open "GET", "http://etfdb.com/etf/EEM/#holdings", False
      .send
      oHtml.body.innerHTML = .responseText
  End With
  
  For Each oElement In oHtml.getElementsByClassName("holdings-left-content")
      ActiveSheet.Range("A1").Value = oElement.Value
  Next oElement
  
  End Sub
  </code></pre>