【数据采集】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

转载于:https://www.cnblogs.com/boluoke/p/6044664.html

你可能感兴趣的:(【数据采集】VBA数据采集可用 COM 组件)