请问各位高手怎么提取http://www.lottery.gov.cn/lottery/qxc/History.aspx?p=1中的开奖数据并写入数组啊?包括开奖日期、开奖号码、开奖期号 

解决方案 »

  1.   

    lz两年前就在问几乎一样的问题,现在还在问,说明根本就是一个伸手党,根本不是来学习和讨论技术问题的。而且,事实上,基本这种研究彩票的人,都是一些贪婪愚蠢的家伙。奉劝lz不要陷入过深。往往越是穷人越是买彩票,结果是越穷。
      

  2.   

    版主不给解答 我来Private Sub Command1_Click()
    Dim oDov As HTMLDocument, iDiv As HTMLDivElement
    Dim date1(1 To 50) As String, result(1 To 50) As StringSet oDov = New HTMLDocument
    url = "http://www.lottery.gov.cn/lottery/qxc/History.aspx?p=1"
    oDov.body.innerHTML = GetHtml(url, "utf-8")
    Set iDiv = oDov.getElementsByTagName("tbody")(8)
    For i = 1 To 49
        date1(i) = iDiv.childNodes(i + 1).childNodes(0).innerText
        result(i) = iDiv.childNodes(i + 2).childNodes(0).innerText
        Text1.Text = Text1.Text & vbCrLf & date1(i) & "--" & result(i)
    Next iEnd Sub'==============================================
    '将网页数据进行转码
    '==============================================
    Function BytesToBstr(strBody, CodeBase)
    On Error Resume Next
    Dim objstream As Object
        Set objstream = CreateObject("Adodb.Stream")
        With objstream
            .Type = 1
            .Mode = 3
            .open
            .Write strBody
            .position = 0
            .Type = 2
            .Charset = CodeBase
            BytesToBstr = .ReadText
            .Close
        End With
        Set objstream = Nothing
    End Function
    '==============================================
      

  3.   

    补一个函数Function GetHtml(ByVal url$, Optional ByVal Coding$ = "gb2312")
    On Error Resume Next
    Dim ObjXML As Object
        Set ObjXML = CreateObject("Microsoft.XMLHTTP")    With ObjXML
            .open "Get", url, False, "", ""
            .setRequestHeader "If-Modified-Since", "0"
            .send
            GetHtml = .responseBody
        End With
        GetHtml = BytesToBstr(GetHtml, Coding)
        Set ObjXML = Nothing
    End Function