无法访问loginbutton..VBA代码

Sub login() Dim IE As Object Dim HTMLDoc As Object, HTMLDoc2 As Object Dim objCollection As Object Const navOpenInNewTab = &H800 Set IE = CreateObject("InternetExplorer.Application") IE.Visible = True IE.Navigate "https:///CWRWeb/displayMemberLogin.do" Do While IE.Busy Or IE.ReadyState <> 4: Loop Set HTMLDoc = IE.Document With HTMLDoc HTMLDoc.getElementByID("userID").Value = "yyyy" 'Entering credential HTMLDoc.getElementByID("passwd").Value = "xxxxx" End With Set objCollection = IE.Document.getElementByID("login-s") objCollection.Click End Sub 

我无法自动login点击。 loginbutton没有用于input的ID。 我不知道用什么来得到句柄.getElementBy ….

表格中有一个名字 – 您可以在填写用户名和密码后直接提交

 HTMLDoc.Forms("loginFormBean").submit