title: How to get 'aria-label' attribute of <a> tag using VBA
body: <p>
  How to get 'aria-label' attribute of  tag when  contains child elements using VBA</p>
  
  <pre class="lang-vb prettyprint-override"><code>&lt;a class=------------"&gt;Update Hire job&lt;/a&gt;
  </code></pre>
  
  <p>I Want this text "Update Hire job" and click the link which is linked with that text
  I am Using the below code and it is not working. :(</p>
  
  <pre class="lang-vb prettyprint-override"><code>Set alllinks = doc.getElementsByTagName("a")
  For Each Hyperlink In alllinks
   If InStr(Hyperlink.innerText, "Update Hire job details") &gt; 0 Then
          Hyperlink.Click
          Exit For
      End If
  Next
  </code></pre>
  
  
  
  <blockquote>
  <pre class="lang-vb prettyprint-override"><code>&lt;tbody&gt;
    &lt;!-- Irrelevant Code Not Typed --&gt;
    &lt;tr id="tr_8577F437734C433CE0538CC810AC9286" aria-label="Update Hire job details" headers="task" scope="row"&gt;
      &lt;div&gt; data-swf-tast-is-claimable="true" data-swf-task-is-actionable="true" data-swf-task-status="null" data-swf-task-is-reopenable="false" data-swf-task-ID="8577F437734C433CE0538CC810AC9286"&gt;
      &lt;span class="control"&gt;
        &lt;a class="name" href="/wps/moportal/$tenant/ICantBeBotheredToTypeThisAllOutEither/"&gt;Update Hire job details&lt;/a&gt;
  </code></pre>
  </blockquote>
  
  <p><a href="https://i.stack.imgur.com/W1ykF.png" rel="nofollow noreferrer">Original HTML Code as Image</a></p>