DataTables("表A").DataRows.Clear()
Dim sr As String = Format(Date.Today(), "yyyyMMdd")
Dim zr As String = Format(Date.Today(), "yyyyMMdd")
Dim web As New System.Windows.Forms.WebBrowser()
web.ScriptErrorsSuppressed = True
web.Navigate("http://fund.eastmoney.com/data/fundranking.html#tall;c0;r;s6yzf;pn50;ddesc;qsd" & sr & ";qed" & zr & ";qdii;zq;gg;gzbd;gzfs;bbzt;sfbb")
Do Until web.ReadyState = 4 AndAlso web.Document.GetElementsByTagName("table").count > 0
Application.DoEvents
Loop
Dim trs1 As object = web.Document.GetElementById("pagebar").GetElementsByTagName("label") '共页码
Dim n1 As Integer = trs1(6).InnerText
For n2 As Integer = 1 To n1
Dim elems As object = web.Document.GetElementById("pagebar").GetElementsByTagName("label") '共页码
Dim sdt As Date = Date.Now
While Date.Now < sdt.AddSeconds(0.1)
Application.DoEvents
End While
For Each elem As object In elems
If elem.InnerText = "下一页" Then
elem.InvokeMember("click")
End If
Next
Dim trs2 As object = web.Document.GetElementById("dbtable").GetElementsByTagName("tr") '表
Dim sdt1 As Date = Date.Now
While Date.Now < sdt1.AddSeconds(0.1)
Application.DoEvents
End While
For i As Integer = 1 To trs2.count - 1
Dim tds1 = trs2(i).GetElementsByTagName("td") '数据
Dim tds2 = trs2(i).GetElementsByTagName("a") '代码名称
Dim dr As Row = Tables("表A").AddNew()
dr("第一列") = tds2(0).InnerText '基金代码
dr("第二列") = tds2(1).InnerText '基金简称
dr("第三列") = tds1(4).InnerText '日期
dr("第四列") = tds1(5).InnerText '单位净值
dr("第五列") = tds1(6).InnerText '累计净值
dr("第六列") = tds1(7).InnerText '日增长率
dr.Save()
Next
Next