0
大家好,在我訪問& VBA小應用程序的功能打開一個網頁,填寫用戶名和密碼,然後登錄。VBA打開網頁,登錄並獲得打開的頁面
如何從剛剛登錄的打開的網頁中讀取文本字段和其他內容,而不是在具有相同鏈接的新網頁中打開?
這是我的代碼。
感謝所有
Private Sub myButton_Click()
Dim IE As Object
Dim IEDoc As HTMLDocument
Set IE = CreateObject("InternetExplorer.application")
Set IEDoc = IE.Document
IE.Navigate "http://mylogin.com"
Do While IE.Busy: DoEvents: Loop
While IE.ReadyState <> READYSTATE_COMPLETE
DoEvents
Wend
With IEDoc
.getElementsByName("userid")(0).Value = "user"
.getElementsByName("password")(0).Value = "password"
.getElementById("btn_login").Click
End With
'At this point, I would read a text field from the new opened page, after login, in the same browser (not from a new webpage with the same link)