title: In VBA, How can we get data shown up with "Inspect Element", but not with "View Page Source"?
body: <p>I am trying to scrape a web page which includes multiple tabs. I want to get the quarterly data which is displayed when clicking on By-Quarter Tab, but my code keeps returning yearly data shown when clicking By-Year Tab.
  The problem is both types of data are on the same URL and when right-clicking “Inspect Element”, their IDs are also the same; you cannot distinguish the quarterly data element ID from yearly data data element ID.
  &quot;Inspect Element&quot; shows up both quarterlyand yealy data, but “View Page Source” shows up only yealy ones.
  Could anyone show me how to get  the quarterly data please? Thank you very much.</p>
  <pre><code>   Sub Getquarterdata()
  
      Dim html As HTMLDocument
      Set html = New HTMLDocument
      
      URL = &quot;https://s.cafef.vn/hose/VCB-ngan-hang-thuong-mai-co-phan-ngoai-thuong-viet-nam.chn&quot;
   
      With CreateObject(&quot;MSXML2.XMLHTTP&quot;)
          .Open &quot;GET&quot;, URL, False
          .SetRequestHeader &quot;User-Agent&quot;, &quot;Mozilla/5.0&quot;
          .send
          html.body.innerHTML = .responseText
  
      End With
  
          ' By &quot;Inspect Element&quot; pointing at Quarterly Data, I counted &quot;td&quot; and came with these lines of code, but they print yearly data.
            Debug.Print html.getElementById(&quot;divHoSoCongTyAjax&quot;).getElementsByTagName(&quot;td&quot;)(23).innerText  '=&gt; Print  9,091,070,000 (Year 2017 data)
            Debug.Print html.getElementById(&quot;divHoSoCongTyAjax&quot;).getElementsByTagName(&quot;td&quot;)(24).innerText  '=&gt; Print 14,605,578,000 (Year 2018 data)
            Debug.Print html.getElementById(&quot;divHoSoCongTyAjax&quot;).getElementsByTagName(&quot;td&quot;)(25).innerText  '=&gt; Print 18,510,898,000 (Year 2019 data)
            Debug.Print html.getElementById(&quot;divHoSoCongTyAjax&quot;).getElementsByTagName(&quot;td&quot;)(26).innerText  '=&gt; Print 18,451,311,000 (Year 2020 data)
           ' The thing is that Quarterly Data shows up only with &quot;Inspect Element&quot;, but not with &quot;View Page Source&quot;
      Set html = Nothing
   
  </code></pre>
  <p>End Sub</p>
  <hr />
  <p>Links</p>
  <ol>
  <li><p>URL:  <a href="https://s.cafef.vn/hose/VCB-ngan-hang-thuong-mai-co-phan-ngoai-thuong-viet-nam.chn" rel="nofollow noreferrer">https://s.cafef.vn/hose/VCB-ngan-hang-thuong-mai-co-phan-ngoai-thuong-viet-nam.chn</a></p>
  </li>
  <li><p>Quaterly Data shown when clicking By-Quarter Tab
  <a href="https://drive.google.com/file/d/1oRtrBZxAoKgdE7gMSBsmkpSX_Ljv1c7L/view?usp=sharing" rel="nofollow noreferrer">https://drive.google.com/file/d/1oRtrBZxAoKgdE7gMSBsmkpSX_Ljv1c7L/view?usp=sharing</a></p>
  </li>
  <li><p>Yearly Data shown when clicking By-Year Tab
  <a href="https://drive.google.com/file/d/1-tI5TU7IMOXFIhsfH8tGvsCRoB0O7Xl1/view?usp=sharing" rel="nofollow noreferrer">https://drive.google.com/file/d/1-tI5TU7IMOXFIhsfH8tGvsCRoB0O7Xl1/view?usp=sharing</a></p>
  </li>
  <li><p>Inspect Quaterly Data:
  <a href="https://drive.google.com/file/d/1Xc5hRPTBIKFu7hQoLh4mStp92CxipNpU/view?usp=sharing" rel="nofollow noreferrer">https://drive.google.com/file/d/1Xc5hRPTBIKFu7hQoLh4mStp92CxipNpU/view?usp=sharing</a></p>
  </li>
  <li><p>Inspect yearly Data:
  <a href="https://drive.google.com/file/d/1LedAF3gvAYSIOKOKfZURR9A2rhK0SNgB/view?usp=sharing" rel="nofollow noreferrer">https://drive.google.com/file/d/1LedAF3gvAYSIOKOKfZURR9A2rhK0SNgB/view?usp=sharing</a></p>
  </li>
  </ol>