您的位置:首页 > 移动开发

InternetExplorer.Application

2007-04-12 11:20 393 查看
strIText = GetInnerX("http://www.heise.de","TEXT")
Open "C:/Inner.txt" For Output As #1
Print #1, strIText
Close 1

Function GetInnerX(strURL As String, Optional strWhat As String = "HTML") As String
    Dim IEApp As Object
    Dim IEDoc As Object
    GetInnerX = ""
    Set IEApp = CreateObject("InternetExplorer.Application")
    If Not IEApp Is Nothing Then
        IEApp.Visible = False
        IEApp.Navigate strURL
        Do: Loop Until IEApp.Busy = False
        Do: Loop Until IEApp.Busy = False
        Set IEDoc = IEApp.Document
        Select Case UCase(strWhat)
            Case "HTML"
                GetInnerX = IEDoc.Body.InnerHTML
            Case Else
                GetInnerX = IEDoc.Body.InnerText
        End Select
        IEApp.Quit
        Set IEDoc = Nothing
        Set IEApp = Nothing
    Else
        MsgBox "InternetExplorer nicht installiert?", vbInformation
    End If
End Function
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息