title: How to get the href attribute using excel vba
body: <p>I want to retrieve the href attribute of the <code>&lt;h3&gt;</code> tags of an html page, I am able to get the innerText, but I don't know how to access the href attribute, there are several <code>&lt;h3&gt;</code> tags in the document, but for the time being I just need the first one. I will deal with the rest later...</p>
  
  <p>This is the code I got so far</p>
  
  <pre><code>Sub Scrap()
  
  Dim IE As New InternetExplorer
  Dim sDD As String
  Dim Doc As HTMLDocument
  
  IE.Visible = True
  IE.navigate "https://www.oneoiljobsearch.com/senior-reservoir-engineer-jobs/?page=1"
  Do
  DoEvents
  Loop Until IE.readyState = READYSTATE_COMPLETE
  Set Doc = IE.document
  sDD = Trim(Doc.getElementsByTagName("h3")(0).innerText) 
  'sDD contains the string "Senior Reservoir Engineer"
  End Sub
  </code></pre>
  
  <p>Below is a portion of the HTML document to extract data from:</p>
  
  <pre><code>  &lt;div class="front_job_details"&gt;
  
      &lt;h3&gt;
          &lt;a href="/jobs/senior-reservoir-engineer-oslo-norway-7?cmp=js&amp;from=job-search-form-2" target="_blank"&gt;
  
          Senior Reservoir Engineer
  
          &lt;/a&gt;
      &lt;/h3&gt;
  </code></pre>
  
  <p>The text I need to retrieve is: "/jobs/senior-reservoir-engineer-oslo-norway-7?cmp=js&amp;from=job-search-form-2"</p>
  
  <p>Thanks in advance for your help. </p>