按照图片建一个名为"号码查询"的表,然后把以下代码放到立即窗口或者按钮中执行
此主题相关图片如下:表结构.jpg
Dim ObjIE As Object = CreateObject("InternetExplorer.Application")
Dim Tbl As Table = Tables("号码查询")
Dim R As Row
'Tbl.DataTable.DataRows.Clear
StatusBar.Message1 = "正在前往网页..."
ObjIE.Navigate("http://video.shishicai.cn/haoma/cqssc/list/120.aspx")
Do Until ObjIE.ReadyState = 4
Application.Doevents
Loop
Dim Dom As Object = ObjIE.Document
Dim HTMLTbl As Object = Dom.GetElementById("bonusNumberData")
Dim RowCnt As Integer = HTMLTbl.Rows.Length
'Tbl.StopRedraw '取消注释此行以提高效率
For i As Integer = 0 To RowCnt - 1
R = Tbl.Rows.AddNew
R("期号") = HTMLTbl.Rows(i).Cells(0).InnerText
R("开奖号码") = HTMLTbl.Rows(i).Cells(1).InnerText
R("开奖时间") = HTMLTbl.Rows(i).Cells(2).InnerText
StatusBar.Message1 = "正在获取第 " & i + 1 & "/" & RowCnt & "行数据..."
Next
'Tbl.ResumeRedraw '取消注释此行以提高效率
StatusBar.Message1 = "数据获取完成..."
ObjIE.Quit
Msgbox("OK")
StatusBar.Reset