这样可以吗? Dim doc As HTMLDocument Set doc = Me.WebBrowser1.Document Set doc = doc.frames("top").Document Dim obj As HTMLHtmlElement For Each obj In doc.All Debug.Print obj.innerHTML Next
使用前必须先引用Microsft html library
使用前必须先引用Microsft html object library
Set doc = doc.frames("top").Document这一句报错,"对象不支持该属性"
Dim doc As HTMLDocument
Set doc = Me.WebBrowser1.Document
Set doc = doc.frames("top").Document
Dim obj As HTMLHtmlElement
For Each obj In doc.All
Debug.Print obj.innerHTML
Next
我碰到有些框架网页内嵌网页,就曾经用过类似:
WebBrowser1.Document.frames.Item(0).frames.Item(1).document......
的方式.
你不是说“框架(top)”吗?你的框架叫什么?我已经试过,的确能取得框架的内容。如果你不清楚框架的名称,可以用索引号