此主题相关图片如下:11.png
代码如下:
Dim web As new System.Windows.Forms.WebBrowser
web.ScriptErrorsSuppressed = True
web.Navigate("http://search.jcrb.com/was5/web/search?page=1&channelid=263328&perpage=10000000&outlinepage=10000000")
Do Until web.ReadyState = 4 AndAlso web.document.GetElementsByTagName("table").count > 1
Application.DoEvents
Loop
Dim str As String = ""
Dim tb1s = web.document.GetElementsByTagName("table")(4) '从第4个<Table>开始查找
For Each tb1 As object In tb1s.GetElementsByTagName("tr")'遍历TR'
Dim sa = tb1.GetElementsByTagName("a")'获取A标签元素'
If sa.count > 0 Then
Dim a = sa(0)
Dim Tel As String = a.InnerHtml
Dim Parts1() As String = Tel.Split("</FONT>")
str &= Parts1(0) & vbcrlf
str &= a.GetAttribute("href") & vbcrlf
Dim shijian As String= (FileSys.GetName(a.GetAttribute("href")).Insert(5,"-")).Insert(8,"-")
Dim Parts() As String = shijian.Split("_")
str & =Parts(0).Remove(0,1) & vbcrlf
End If
Next
output.Show(str)
文章列表源码:
<Table width="980" align="center" border="0" cellpadding="0" cellspacing="5">
<tr>
<td class=f>
<font size="3"><a href="http://www.gzwengan.jcy.gov.cn/jcyw/201605/t20160505_1787530.shtml" target="_blank">加强与代表面对面沟通,进一步提高代表的满意率</font> </a>
<br><font size=-1><font color=#008000>2016.05.05 作者:</font> <br>
<br> 4月27日,瓮安县人民检察院陈德清副检察长和人大代表联络办公室的两名工作人员专程到中坪镇政府向第十六届人大代表?中坪镇人大主席王成伦汇报提案办理情况 <br></font>
</td>
</tr>
</Table>
[此贴子已经被作者于2016/11/2 20:53:15编辑过]