在WEBBROWSER控件中打开一个网页,网页中有两个框架(frame1,frame2),请问怎么样获取frame1中显示的文字是”NEXT“的那个超连接的地址,并且在FRAME1中打开它?

解决方案 »

  1.   

    访问框架中的文档的代码
    Dim pFramesCol As IHTMLFramesCollection2
        Dim pDisp As Object
        Dim IWindow2 As IHTMLWindow2
        Dim i As Integer
        Dim varIndex As Variant
        Dim frameDoc As IHTMLDocument2
        Set pFramesCol = doc.frames
        If Not pFramesCol Is Nothing Then
          For i = 0 To pFramesCol.length - 1
             varIndex = i
             Set pDisp = pFramesCol.Item(varIndex)
             Set IWindow2 = pDisp
             If Not IWindow2 Is Nothing Then
                If Not IWindow2.Document Is Nothing Then                     
                   Set frameDoc = IWindow2.Document
                End If
             End If
          Next i      
       End If
    注意跨域访问框架会有拒绝访问错误。
      

  2.   

    樓上的思路是對的,用HTML對象來解析。
      

  3.   

    还是不懂,楼上两位高人,有没有HTML对象的说明书或教程,能否提供给小弟?
    邮箱:[email protected]
      

  4.   

    http://msdn.microsoft.com/workshop/browser/hosting/hosting.asp
      

  5.   

    你去学学dhtml就没问题了,这个很容易入门的
      

  6.   

    我的主页里有DHTML_HTML_CSS教程,我觉得挺好的,你去看看:
    http://freehost08.websamba.com/hzhzhz/xuexi/!DHTML_HTML_CSS.chm