excel - 如何使用网络抓取从我的网站注销?
问题描述
完成所有报告工作后,我需要帮助才能从我的网页注销。我有登录和使用网页的代码,但我面临注销网页的问题。下面是我使用的代码:
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
解决方案
尝试单击注销锚标记(按 id 定位)
ie.document.querySelector("#LogoutLink").click