请问各位高手怎么提取http://www.lottery.gov.cn/lottery/qxc/History.aspx?p=1中的开奖数据啊

牛记图文 2014-10-11 01:59:19
请问各位高手怎么提取http://www.lottery.gov.cn/lottery/qxc/History.aspx?p=1中的开奖数据并写入数组啊?包括开奖日期、开奖号码、开奖期号
...全文
2791 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
threenewbee 2014-10-13
  • 打赏
  • 举报
回复
lz两年前就在问几乎一样的问题,现在还在问,说明根本就是一个伸手党,根本不是来学习和讨论技术问题的。 而且,事实上,基本这种研究彩票的人,都是一些贪婪愚蠢的家伙。奉劝lz不要陷入过深。往往越是穷人越是买彩票,结果是越穷。
threenewbee 2014-10-13
  • 打赏
  • 举报
回复
用webbrowser或者xmlhttp
windxp1 2014-10-13
  • 打赏
  • 举报
回复
补一个函数 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
windxp1 2014-10-13
  • 打赏
  • 举报
回复
版主不给解答 我来 Private Sub Command1_Click() Dim oDov As HTMLDocument, iDiv As HTMLDivElement Dim date1(1 To 50) As String, result(1 To 50) As String Set 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 i End 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 '==============================================
windxp1 2014-10-13
  • 打赏
  • 举报
回复
不给解答就算了 还损人一顿 至于吗
牛记图文 2014-10-12
  • 打赏
  • 举报
回复
请问各位高手怎么提取http://www.lottery.gov.cn/lottery/qxc/History.aspx?p=1中的开奖数据并写入数组啊?包括开奖日期、开奖号码、开奖期号

7,762

社区成员

发帖
与我相关
我的任务
社区描述
VB 基础类
社区管理员
  • VB基础类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧