使用VBS单击webbrowser中没有类或ID标记的图像文件

时间:2017-03-22 19:15:51

标签: vbscript

下面是我要点击图像文件的标签,该文件将导航到Web浏览器(IE)中的另一个链接,[我尝试使用目标链接,但由于限制我无法粘贴直接网址]

WEb标记下方

<td class="Btext4" align="center" style="border-top-style: none">
 <img onclick="appSubmit('/Web/portlets/applications/redirect.jsp?PARAM=26','26','_blank')" class="applinklnh" src="/ABCD/Content/images/launch_4_june.gif" alt="Launch IPMS" width="94" height="36" border="0" style="cursor:pointer;">
</td>
<td class="Btext4" align="center" style="border-top-style: none">
 <img onclick="appSubmit('/Web/portlets/applications/redirect.jsp?PARAM=26','26','_blank')" class="applinklnh" src="/ABCD/Content/images/launch_4_june.gif" alt="Launch TGIF" width="94" height="36" border="0" style="cursor:pointer;">
</td>

*已编辑:已添加标签以明确我被困的位置

直到我无法对此进行编码,以后的许多尝试我都无法继续前进

            Dim objIE
            Set objIE = CreateObject("InternetExplorer.Application")

            objIE.Visible = True
            CreateObject("WScript.Shell").AppActivate "Internet Explorer"
            objIE.Navigate  "https://www.website.net/"



            While objIE.Busy
            if x = vbNo then
                WScript.Sleep 100000000
            Else
                WScript.Sleep 10
            End if

            Wend

            objIE.Document.getElementById("USER").value = "username"
            objIE.Document.getElementById("PASSWORD").value = "password"
            objIE.Document.getElementById("login_button").click

            While objIE.Busy
              WScript.Sleep 100
            Wend

请帮助我,我做错了什么。感谢

0 个答案:

没有答案