目的:登入網銀
結果:試過以下方式,都無法成功,程式如下:
Sub firstb()
Set ie = CreateObject("InternetExplorer.application")
ie.Visible = True
ie.Navigate ("https://ebank.firstbank.com.tw/PTLB2C/index.xhtml")
'ShowWindow ie.hwnd, SW_SHOWMAXIMIZED
Do While ie.Busy = True Or ie.ReadyState <> 4
DoEvents
Loop
Set a = ie.Document.getElementById("form:custId")
Set b = ie.Document.getElementsByTagName("input")
Set c = ie.Document.getElementsByName("form:custId")(0)
Set d= ie.Document.getElementByclassname("ui-inputfield ui-inputtext ui-widget ui-state-default ui-corner-all inputCheck ui-state-focus")(0)
a.value ="XXXX"
or
b.value="XXXX"
c.value="XXXX"
d.value="XXXX"
End Sub
你要選的目標是在Iframe裡面,要先選到iframe後才能再選
如下
document.getElementById("iFrameID").contentWindow.document.getElementById("form:custId")