【发布时间】:2016-09-29 04:29:58
【问题描述】:
我正在尝试单击网页上的“a”元素,但不知道为什么它不起作用。
这是我的 VBA 代码。
Function answer1(ie3 As InternetExplorer, str_anwer As String, answerid As String)
Dim ie4 As New InternetExplorer
Dim a As Object
Set ie4 = ie3
ie4.Document.getElementbyId("view=" & answerid).Click
ie4.Document.getElementbyId("reply_cont").Value = str_anwer
End Function
错误:找不到属性
这是我认为它所在网页的 HTML 代码
<tr>
<td class="thm">208975260</td>
<td><pre>교환</pre></td>
<td class="subject"><a href="#" onClick="return toggleDetail('208975260');" id="view208975260">작동이안되서 교환 원합니다 어떻게 하면되나요?</a></td>
<td class="id"><span class="thm">st******</span><br>한혜진</td>
<td class="thm">2016.09.29 12:53:57</td>
<td id="date208975260"><span class="point2 ls1">미답변</span>
</td>
<td class="ansr">-</td>
</tr>
对不起我的英语
我的英语不流利。
请告诉我为什么它不起作用
【问题讨论】:
-
在
getElementbyId("view=" & answerid)中,=不应该存在。结果应该是id="view208975260"而不是id="view=208975260"。 -
谢谢。我修复了它但没有工作.... ie4.Document.getElementbyId("view" & answerid).Click erro:Property not found
标签: html vba internet-explorer getelementbyid