谢谢!我是菜鸟,请指点,如何才能得到此好像是“HTML”网页地址,我查了网页“网页源代码”和“开发人员工具”也不得其法。
要获取“http://data.10jqka.com.cn/market/lhbyyb/orgcode/CTZQGFYXGSWLDHBLZQYYB/”网页数据,
不知是否还可以用您给的方法,但我还是用贵网“专家堂”指点的方法克隆了一段代码,还是不得要领,
仅能获得首页数据,请老师指点。
Dim web As new System.Windows.Forms.WebBrowser
web.Navigate("http://data.10jqka.com.cn/market/lhbyyb/orgcode/CTZQGFYXGSWLDHBLZQYYB/")
Do Until web.ReadyState = 4
Application.DoEvents
Loop
Dim pg = web.Document.GetElementById("yybid")
pg.SetAttribute("data-param", "3")
For Each a As object In web.Document.GetElementById("yybid").GetElementsByTagName("a")
If a.GetAttribute("ClassName") = "changePage" Then
a.InvokeMember("data-param")
Exit For
End If
Next
For Each div As object In web.Document.GetElementsByTagName("div")
If div.GetAttribute("ClassName") = "cur" Then
Dim sa = div.GetElementsByTagName("a")
Do Until sa(0).InnerText = 3
Application.DoEvents
Loop
ElseIf div.GetAttribute("ClassName") = "zdph" Then
For Each tr As object In div.GetElementsByTagName("tr")
Dim str As String = ""
Dim tds = tr.GetElementsByTagName("td")
For i As Integer = 0 To tds.count - 1
str &= tds(i).InnerText & " "
Next
output.show(str)
Next
End If
Next