下面的程序可以正常将表格中的文本写入文件
Dim Tables, T As IHTMLElementCollection
Set doc = WebBrowser1.Document
Set T = WebBrowser1.Document.frames(1).Document.getElementsByTagName("TABLE")
Set Tables = T.Item(0, 0).All.tags("Table").Item(4, 4)
Open "C:\test.TXT" For Output As #1
For i = 0 To Tables.rows.length - 1
Set ROW = Tables.rows(i)
tmp = ""
For j = 0 To Tables.cells.length / Tables.rows.length - 1
tmp = tmp & "," & ROW.cells(j).innerText
Next
Print #1, tmp
Next
Close #1
但是我想实现逐个点击表格中的每一行,查看了好多资料都没有,恳请各位给出个好主意,明确一下我应该如何实现
Dim Tables, T As IHTMLElementCollection
Set doc = WebBrowser1.Document
Set T = WebBrowser1.Document.frames(1).Document.getElementsByTagName("TABLE")
Set Tables = T.Item(0, 0).All.tags("Table").Item(4, 4)
For i = 0 To Tables.rows.length - 1
Set ROW = Tables.rows(i)
Call ROW.click()
Next <div class="content-box"><div class="content-box-content"><div class="tab-content default-tab" id="tab1"><table width="70%"><thead><tr><th>SKU</th><th>尺码</th><th>货品</th><th>品牌</th><th>数量</th></tr></thead><tbody><tr><td>ND20120723-1233</td><td>-</td><td><a href="/admin/product/read/id/2812">ZAMO油画真皮信封包</a></td><td><a href="/admin/brand/read/id/366">ZAMO</a></td><td>1</td></tr></tbody></table></div></div><!-- End .content-box-content --></div>