0

('href' )呼び出された「WS557568037 / Personal Workspace」をクリックする必要がありますが、何も機能しません。私はこのコードを試しました:

'Dim htmlElement As MSHTML.IHTMLElement  For Each htmlElement In HTML.getElementsByClassName("hoverLink")'Debug.Print htmlElement.getAttribute("href") 
htmlElement.Click  Next htmlElement

Dim evt As Object, evt1 As Object Set evt = HTML.createEvent("HTMLEvents") 
evt.initEvent "mouseover", True, False IE.Document.querySelector(".hoverLink").dispatchEvent evt IE.Document.querySelector(".hoverLink").Focus  IE.Document.querySelector(".hoverLink").click 

HTML

<div class="tableBody" _tbid="_ygf1bc" style="height: 69px;">
<table class="tableBody" id="_ygf1bc" cellspacing="0" cellpadding="0">

<tbody><tr class="AWTColAlignRow"><td width="1px" style="padding-right: 18px;"></td><td width="" style="padding-right: 27px;"></td><td width="" style="padding-right: 38px;"></td><td width="" style="padding-right: 56px;"></td><td width="" style="padding-right: 50px;"></td><td class="spacer"></td></tr><tr class=" firstRow tableRow1" id="_igbn9d" dr="1" _awtisprimaryrow="1">
<td align="center" class="a-portlet-icon-cell tableBody w-tbl-cell">
<div class="w-doc-portlet-status-hide"></div>
<a id="_a$7voc" href="#" bh="HL" _sf="false"><span class="a-doc-icon-portlet">
<span data-icon="&quot; class="w-icon-default" aria-hidden="true" role="img"></span>

</span>
</a>
</td>


<tr class=" tableRow1" id="_hm6qw" dr="1" _awtisprimaryrow="1">
<td align="center" class="a-portlet-icon-cell tableBody w-tbl-cell">
<div class="w-doc-portlet-status-hide"></div>
<a id="_ayuojd" href="#" bh="HL" _sf="false"><span class="a-doc-icon-portlet">
<span data-icon="&quot; class="w-img" aria-hidden="true" role="img"></span>

</span>
</a>
</td>
<td class="tableBody w-tbl-cell">
<a id="_x2w3t" href="#" bh="HL" _sf="false">WS557568037</a></td>
<td class="tableBody w-tbl-cell">

<a id="_moz9p" href="#" bh="HL" _sf="false" class="hoverLink">Personal Workspace</a>

</td>
<td class="noWrap tableBody w-tbl-cell">

12/18/2020
</td>
<td class="noWrap tableBody w-tbl-cell">

<span class="">Active</span>
</td>
</tr>
</tbody></table></div>
4

1 に答える 1