首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > VB Dotnet >

网页上的table表格,小弟我用webbrowser控件操作时遇到的有关问题

2012-05-22 
网页上的table表格,我用webbrowser控件操作时遇到的问题?VB.NET codeDim kkk As mshtml.IHTMLDocument Di

网页上的table表格,我用webbrowser控件操作时遇到的问题?

VB.NET code
        Dim kkk As mshtml.IHTMLDocument        ' Dim div As mshtml.HTMLDivElement        kkk = WebBrowser1.Document.Window.Frames("pagearea").Frames(2).Document.DomDocument        Dim col As mshtml.IHTMLTable        Dim tablerow As mshtml.IHTMLTableCell        ' Dim cel As mshtml.HTMLTableCell        col = kkk.getElementById("tabList2")        tablerow = col.rows(0)


tablerow = col.rows(0)这句提示错误:没有默认属性,因此不能被索引,我想引用这个表的行,该如何解决?

[解决办法]
不是没人要分,而是很少有人用webbrowser去操作html table
给code,自己研究一下
Dim range As IHTMLControlRange = CType(document.selection.createRange, IHTMLControlRange)
 Dim f As mshtml.HTMLTable = CType(range.item(0), mshtml.HTMLTable)
 For Each r As mshtml.HTMLTableRow In f.rows
'遍历行
For Each c As mshtml.HTMLTableCell In r.cells
'遍历列
Next
 Next

热点排行