Dim web As new System.Windows.Forms.WebBrowser
web.ScriptErrorsSuppressed = True
Dim lmdz As WinForm.ComboBox = e.Form.Controls("ComboBox3")
web.Navigate(lmdz.Value)
'web.Navigate("http://www.gzfuquan.jcy.gov.cn/gzdt")
Do Until web.ReadyState = 4
Application.DoEvents
Loop
Dim obj = web.document.GetElementsByTagName("table")(37)
Dim count = obj.InnerText.Substring(1,1)
msgbox(count)
For i As Integer = 1 To count
Dim pg = web.Document.GetElementById("num")
pg.SetAttribute("Value", i)
Dim inputs = web.Document.GetElementsByTagName("input")
For Each input As object In inputs
If input.GetAttribute("type") = "submit" Then
input.InvokeMember("click")
Do Until web.document.GetElementsByTagName("table").count > 36
Application.DoEvents
Loop
Dim tb1s = web.document.GetElementsByTagName("table")(36)
For Each tb1 As object In tb1s.GetElementsByTagName("tr")
Dim sa = tb1.GetElementsByTagName("a")
If sa.count > 0 Then
Dim a = sa(0)
Dim dr As DataRow = DataTables("官网文章").AddNew()
Dim fwdw As WinForm.ComboBox = e.Form.Controls("ComboBox1")
Dim lmfl As WinForm.ComboBox = e.Form.Controls("ComboBox2")
dr("单位") = fwdw.Value
dr("文章标题") = a.innertext
dr("文章分类") =lmfl.Value
dr("网址") = a.GetAttribute("href")
Dim shijian As String = (FileSys.GetName(a.GetAttribute("href")).Insert(5,"-")).Insert(8,"-")
Dim Parts() As String = shijian.Split("_")
dr("发布时间") =Parts(0).Remove(0,1)
End If
Next
End If
Next
Next