以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  [求助]取网页DIV标签下面DIV的内容  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=109329)

--  作者:ymjr2011
--  发布时间:2017/11/9 15:40:00
--  [求助]取网页DIV标签下面DIV的内容

图片点击可在新窗口打开查看此主题相关图片如下:qq浏览器截屏未命名.png
图片点击可在新窗口打开查看


Output.Clear
Dim web As New System.Windows.Forms.WebBrowser()
web.Navigate("http://www.cinic.org.cn/zgzz/xw/408320.html")
Do Until web.ReadyState = 4
    Application.DoEvents
Loop
Dim str As String

Dim elems As object = web.Document.GetElementById("bd").GetElementsByTagName("div")

For Each elem As object In elems
    Dim tdelems As object =  elem.GetElementsByTagName("div")
    Output.Show(tdelems(0).InnerText )
    
    
Next
\'

大概写了下,不对,请指正下

--  作者:有点甜
--  发布时间:2017/11/9 15:48:00
--  

Dim web As New System.Windows.Forms.WebBrowser()
web.Navigate("http://www.cinic.org.cn/zgzz/xw/408320.html")
Do Until web.ReadyState = 4
    Application.DoEvents
Loop

Dim elems As object = web.Document.GetElementById("bd").GetElementsByTagName("div")
For Each elem As object In elems
    If elem.getattribute("className") = "dc-ccm1" Then
        Dim divs As object = elem.GetElementsByTagName("div")
        For Each div As object In divs
            output.show(div.innertext)
        Next
    End If   
Next


--  作者:ymjr2011
--  发布时间:2017/11/9 17:01:00
--  
谢谢