Dim web As new System.Windows.Forms.WebBrowser
web.ScriptErrorsSuppressed = True
web.navigate("http://glj.fjgczj.com/Information/Index")
Do Until web.ReadyState = 4 ' 4
Application.DoEvents
Loop
Dim tbs = web.Document.GetElementsByTagName("table")'是根据控件TAG获取这个控件对象,返回的是一个对象数组
For i As Integer = 0 To tbs.count-1 '2
Dim tb = tbs(I)
Dim trs = tb.GetElementsByTagName("tr") '
For Each tr As object In trs
Dim tds = tr.GetElementsByTagName("td") '
Dim dr As DataRow
dr = DataTables("信息价").AddNew()
dr("材料编码") = tds(0).Innertext
dr("材料名称") = tds(1).Innertext
dr("规格") = tds(2).Innertext
dr("不含税综合价") = tds(3).Innertext
dr("单位") = tds(4).Innertext
dr("含税综合价") = tds(5).Innertext
dr("备注") = tds(6).Innertext
'dr("年份") = tds(0).Innertext
'dr("月") = tds(0).Innertext
'dr("地区") = tds(0).Innertext
Next
Next
数据网址:http://glj.fjgczj.com/Information?Year=2018&Month=01&WayID=14&WayID2=4&CityID=7&CityID2=93&qKeyWord=
[此贴子已经被作者于2018/9/15 13:34:58编辑过]