title: VBA to fetch attribute values from HTML
body: <p>I am trying to create macro where it will fetch the data from particular attribute, and simply paste on excel, I tried it using getElementsById, but its not working for me.</p>
  
  <p>I have link:<br>
  <a href="https://secure.bmw.com/_common/silo/pages/form-tabs/controller_opt.jsp?locale=XQ_en&amp;usercountry=IN&amp;tracking_usercountry=IN&amp;tracking_locale=XQ_en&amp;transfer=f23_info_req_lp" rel="nofollow">https://secure.bmw.com/_common/silo/pages/form-tabs/controller_opt.jsp?locale=XQ_en&amp;usercountry=IN&amp;tracking_usercountry=IN&amp;tracking_locale=XQ_en&amp;transfer=f23_info_req_lp</a></p>
  
  <p>Just view source it and you will find the attribute name "lead context"</p>
  
  <pre><code>&lt;input type="hidden" name="reg_source" value="OPK"&gt;
  &lt;input type="hidden" name="lead_context" value="F45CV ROI OPK"&gt;
  &lt;input type="hidden" name="subscription_lead_context" value="F45CV ROI OPK"&gt;
  &lt;input type="hidden" name="cam_source_code" value="1-1521452141"&gt;
  &lt;input type="hidden" name="offer_code" value="1524521452"&gt;
  </code></pre>
  
  <p>So basically I want value "OPK", "F45CV ROI OPK", "1-1521452141" and "1524521452" on excel sheet.</p>
  
  <p>Can anyone help me with simple code, Sorry for as i am new in VBA.</p>
  
  <p>Thanks for your time :)</p>
  
  <p>Regards,
  Mayur</p>