这个确实有点困难,不知怎么调用递归,这个有点像迷宫的算法,就是不知道怎么实现 我是利用了访问webbrowser出错这个来做的,只做了下面一点,请高手补充完整'得到第一层的深度 Private Sub Command1_Click() Dim i As Integer Dim strResult$, s$ Dim obj1 As Object
Set obj1 = WebBrowser1.Document
On Error Resume Next i = 0 Do s = obj1.Frames(i).Document.body.outerhtml Set obj1 = obj1.Frames(i).Document If Err.Number = -2147352567 Then Exit Do strResult = strResult & i & vbCrLf Loop MsgBox strResult End Sub
我是利用了访问webbrowser出错这个来做的,只做了下面一点,请高手补充完整'得到第一层的深度
Private Sub Command1_Click()
Dim i As Integer
Dim strResult$, s$
Dim obj1 As Object
Set obj1 = WebBrowser1.Document
On Error Resume Next
i = 0
Do
s = obj1.Frames(i).Document.body.outerhtml
Set obj1 = obj1.Frames(i).Document
If Err.Number = -2147352567 Then Exit Do
strResult = strResult & i & vbCrLf
Loop
MsgBox strResult
End Sub
|-a00-|-a000
|-a0-|-a01
| |-a02
a-|
| |-a10
|-a1-|
|-a11-|-a110-|-1100源文件下载:http://www.symental.com/sfw?f=frames
谢谢先!