AutoHotKey Internet Explorer对象检索跨度标记文本

时间:2015-05-08 16:44:15

标签: html internet-explorer autohotkey

从目标页面我发现:

<legend><span class="labelOnMed">Plan name:</span> <span class="textOnMed">myCompanyName</span></legend>

有没有办法在特定的<span>代码中检索或提取文字?

Loop %numberOfLink%
    {
        If (Links[A_Index-1].InnerText == cin) {
            Links[A_Index-1].Click()
            IELoad(wb)

            planID := wb.document.getElementsByTagName("textOnMed")
            MsgBox, %planID%
        }
    }

我也尝试过:

planID := wb.document.getElementsByTagName("textOnMed")
planString := planID.value
MsgBox, %planID%

1 个答案:

答案 0 :(得分:1)

planID := wb.document.getElementsByClassname("textOnMed")[0].innerText