VBA IE Automation - Read iFrame

后端 未结 4 2039
小鲜肉
小鲜肉 2020-12-03 18:05

Our business uses a browser-based program for operations. I\'m automating a solution to navigate through this site, and retrieve some data at the end.

The site itsel

相关标签:
4条回答
  • 2020-12-03 18:35

    Try this...

    Dim elemCollection As IHTMLElementCollection
    
    Set elemCollection = objDoc.frames("iFrameID").document.all
    Debug.Print elemCollection.Item("pagemenuli-adv").innerText
    
    0 讨论(0)
  • 2020-12-03 18:36

    Try to use:

    `Dim iFrm As HTMLIFrame
    Set iFrm = ie.document.frames(myFrameNum).document.getElementByID("iFrameID")
    Debug.Print iFrm.contentDocument.body.innerHTML`
    
    0 讨论(0)
  • 2020-12-03 18:51

    I faced the same issue and I got the solution using the following line of script..

    IE.Document.getElementsbyTagName("iframe")(0).contentDocument.getElementsbyTagName("body")(0).innertext

    0 讨论(0)
  • 2020-12-03 18:52

    I faced a similar problem, finally solved it using:

    ObjIE.document.frames(0).document.forms(0).innerText

    Note: The text which I was in need was present in form which is located in a iframe.

    Am new to VBA, can some body explain what exactly 0 in Frames(0)/forms (0) is?

    If it something like Frame index or frame number(As of my assumption) please let me know how can we find frame index(in any HTML)?

    0 讨论(0)
提交回复
热议问题