【发布时间】:2018-07-02 15:31:42
【问题描述】:
<td class="sell">
<button class="btnSell btnSell-highlight" title="Sell @ 1.3" id="btnSell-group_a.5c653e67-61dc-4e0c-97dc-ca44476dfb76.manual.adecf17a-35f2-4ac4-b337-bbfbb5e42ec4">1.3</button>
</td>
您好,我是使用 Excel VBA 的新手。我的目标是获得 1.3 的十进制值。 我尝试通过以下代码提取此值:
Sub ExtractLastValue()
Set objIE = CreateObject("InternetExplorer.Application")
objIE.Visible = True
objIE.Navigate ("Enter webiste name")
Do
DoEvents
Loop Until objIE.readystate = 4
MsgBox objIE.document.getElementsByclassname("sell")(0).getElementsbyid("btnSell-group_a.5c653e67-61dc-4e0c-97dc-ca44476dfb76.manual.adecf17a-35f2-4ac4-b337-bbfbb5e42ec4").innertext
End Sub
但是,一旦我运行代码,就会出错:
错误时间 438:对象不支持此属性或方法。
【问题讨论】: