以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  [求助]如何抓取网页固定行数的数据  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=78609)

--  作者:智友软件工作室
--  发布时间:2015/12/12 23:35:00
--  [求助]如何抓取网页固定行数的数据
http://hrcp.co/page/YLFXssc.shtml?id=15
如何抓取这个网页1到15行的数据然后存储到狐表的数据表中?多谢

--  作者:大红袍
--  发布时间:2015/12/13 12:50:00
--  

Dim web As new System.Windows.Forms.WebBrowser
web.Navigate("http://hrcp.co/page/YLFXssc.shtml?id=15")
Do Until web.ReadyState = 4
    Application.DoEvents
Loop

For Each tr As object In web.Document.GetElementsByTagName("tr")
    If tr.GetAttribute("ClassName") = "ylfx_content"
        Dim str As String = ""
        For Each td As object In tr.GetElementsByTagName("td")
            str &= td.InnerText & "   "
        Next
        output.show(str)
    End If
Next