【数据采集】VBA数据采集可用 COM 组件

windows 中提供了4个COM组件都可以进行数据采集。

Wininet

WinHttp

XmlHttp

MSHTML

https://msdn.microsoft.com/en-us/library/bb508515(v=vs.85).aspx
https://msdn.microsoft.com/en-us/library/hh801967(v=vs.85).aspx

    Dim objMSHTML As New HTMLDocument
    Dim objDocument As HTMLDocument

    Dim FSO As New FileSystemObject
    Dim TS  As TextStream

    Set TS = FSO.OpenTextFile("c:\dkfj.html", ForWriting, True, TristateTrue)
    TS.write T.GetChildTaskInfo("1432912514")
    TS.Close

    Set objDocument = objMSHTML.createDocumentFromUrl("C:\dkfj.html", "")

    Set FSO = Nothing

MSXML

Sub Macro1()

    Dim objMSHTML As New MSHTML.HTMLDocument
    Dim objDocument As MSHTML.HTMLDocument
    
    Set objDocument = objMSHTML.createDocumentFromUrl("http://hao123.com", "")
    
End Sub
posted @ 2016-11-08 21:09  小BIBO  阅读(700)  评论(0编辑  收藏  举报