PDA

View Full Version : document.iframes does not work



adeleon
02-15-2014, 01:55 PM
Hi. As long as I've seen the vollowing code should work:


Sub iFrameInnerHTML()
Const cURL = "https://invest.ameritrade.com/grid/p/login?logout=L&promo=3"
Set IE = New InternetExplorer
IE.Visible = True
IE.Navigate cURL

Do While IE.READYSTATE <> READYSTATE_COMPLETE Or IE.Busy: DoEvents: Loop

Dim iFrm As HTMLIFrame
Set iFrm = IE.Document.frames(1).Document.getElementById("noscript-frame")
Debug.Print iFrm.Document.body.innerText

End Sub


But I obain an error in "set iFrm = ...." line.


Any help would be appreciated.
Alvaro de Leon

westconn1
02-16-2014, 01:52 AM
as far as i can tell, as that element is within a noscipt block, it will only exist in the case a a browser with scripting disabled (this can be tested, by turning off scripting)
it would appear that the login form is contained in a data-dojo (mystry to me)
no frames or forms appear to be contained within the main document