完成所有报告工作后,我需要帮助从网页注销。我有登录和使用该网页的代码,但是注销网页时遇到了问题。下面是我使用的代码:
Dim ie As InternetExplorer
Dim ieDoc As Object
Dim ieTable As Object
Dim clip As DataObject
Set ie = New InternetExplorer
With ie
.Visible = True
.navigate "abc.com"
Do Until .readyState = 4
DoEvents
Loop
("UserName").Value = "****"
("Password").Value = "*******"
.submit
End With
''''''''''''''''''''''''''''''''''
'my body of the code goes here
''''''''''''''''''''''''''''''''''
'''''Before the Sub ends i need the logout code to logout from the web page
End Sub
答案 0 :(得分:1)
尝试单击注销锚标记(按ID定位)
ie.document.querySelector("#LogoutLink").click