vb webbrowser 获取 class DIV等值
有一段代码<divclass="subNavList"><divclass="charNav"><strong><imgsrc="/template/default2.6...
有一段代码
<div class="subNavList">
<div class="charNav">
<strong><img src="/template/default2.6/images/btn-chrlist.gif"></strong><a href="/search.asp?searchtype=4&searchword=A">A</a><a href="/search.asp?searchtype=4&searchword=B">B</a><a href="/search.asp?searchtype=4&searchword=C">C</a><a href="/search.asp?href="/search.asp?searchtype=4&searchword=X">X</a><a href="/search.asp?searchtype=4&searchword=Y">Y</a><a href="/search.asp?searchtype=4&searchword=Z">Z</a>
</div>
该如何获取DIV中的链接呢,和连接名
就是获取只大牛股DIV,class 里面的内容值 展开
<div class="subNavList">
<div class="charNav">
<strong><img src="/template/default2.6/images/btn-chrlist.gif"></strong><a href="/search.asp?searchtype=4&searchword=A">A</a><a href="/search.asp?searchtype=4&searchword=B">B</a><a href="/search.asp?searchtype=4&searchword=C">C</a><a href="/search.asp?href="/search.asp?searchtype=4&searchword=X">X</a><a href="/search.asp?searchtype=4&searchword=Y">Y</a><a href="/search.asp?searchtype=4&searchword=Z">Z</a>
</div>
该如何获取DIV中的链接呢,和连接名
就是获取只大牛股DIV,class 里面的内容值 展开
展开全部
Dim i As HTMLDTElement
Dim a As HTMLDTElement
For Each i In WebBrowser1.document.getElementsByTagName("DIV")
If i.className = "charNav" Then
For Each a In i.getElementsByTagName("A")
List1.AddItem i.getAttribute("href")
Next
End If
Next
更多追问追答
追问
Dim i As HTMLDTElement
用户类型未定义怎么整
追答
工程 引用 Microsoft HTML Object Library
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询