【发布时间】:2016-05-19 22:46:18
【问题描述】:
我想做的是打开一个网站,然后按下一个按钮。我不能让它工作,所以我要求你们所有有经验的程序员!
按钮xml记录为:
z-menu-item-inner-r"><span class="z-menu-item-space"></span></td></tr></tbody></table></a></td><td id="z_e6_mm" align="left" z.type="Menuit2" class="z-menu-item " style="padding-left:4px;padding-right:4px;" z.zcls="z-menu-item" z.top="true"><a href="/NTS/NTSBatchJobs.zul" class="z-menu-item-cnt"><table id="z_e6_mm!a" cellspacing="0" cellpadding="0" border="0" class="z-menu-item-body " style="width: auto;"><tbody><tr><td class="z-menu-item-inner-l"><span class="z-menu-item-space"></span></td><td class="z-menu-item-inner-m"><div><button id="z_e6_mm!b" type="button" class="z-menu-item-btn">**HIT ME** </button></div></td><td class="
我尝试按下的按钮名为: 打我
我使用的代码是:
Sub IE_Auto()
Dim i As Long
Dim IE As Object
Dim objElement As Object
Dim objCollection As Object
Set IE = CreateObject("InternetExplorer.Application")
IE.Visible = True
IE.Navigate "mysite"
Set elems = IE.Document.getElementsByTagName("button")
For Each e In elems
If e.Name = "Hit Me" Then
e.Click
Exit For
End If
Next e
End Sub
【问题讨论】: