Hello, all,
I am trying to extract the HREF value, but I have <a> without a name and I'm stumped. What am I missing that would allow me to obtain the HREF (javascript:gvClosuresSelectRow('802c3a43-f761-4618-94c7-ade013516718') as per below.
My code is as follows:
This just lists all Elements with tag, but I need to target only this particular href
I am trying to extract the HREF value, but I have <a> without a name and I'm stumped. What am I missing that would allow me to obtain the HREF (javascript:gvClosuresSelectRow('802c3a43-f761-4618-94c7-ade013516718') as per below.
My code is as follows:
VBA Code:
Dim htmlElement As MSHTML.IHTMLElement
For Each htmlElement In IE.document.getElementsByTagName("A")
Debug.Print htmlElement.getAttribute("href")
htmlElement.Click
Next htmlElement
This just lists all Elements with tag, but I need to target only this particular href
VBA Code:
<tbody>
<tr class="GridRow GridViewRow">
<td style="width:auto;"><a href="javascript:gvClosuresSelectRow('802c3a43-f761-4618-94c7-ade013516718');" title="Screening Incomplete Nov 25, 2021">Select</a></td>
<td style="width:auto;">Screening Incomplete</td>
<td style="width:auto;">Nov 25, 2021</td>
</tr>
<tr class="GridRow GridViewAltRow">
<td style="width:auto;"><a href="javascript:gvClosuresSelectRow('7c4b2673-f65b-4ae5-9031-8dd9621903ca');" title="System Closure Nov 28, 2021">Select</a></td>
<td style="width:auto;">System Closure</td>
<td style="width:auto;">Nov 28, 2021</td>
</tr>