比如上面这个页面,取数据不难,主要是直观,所以我用的方法是用数组与字典结合的方式:
Dim oTable Set Table = Browser("无标题文档").Page("无标题文档").WebTable("表格") Dim oRow, oCol oRow = oTable.RowCount oCol = oTable.ColumnCount(1) Dim arrData() ReDim arrData(oRow) Dim i , j For i = 1 to oRow-1 Set arrData(i)=CreateObject("Scripting.Dictionary") For j = 1 to oCol arrData(i).Add Trim(oTable.GetCellData(1,j)) , oTable.GetCellData(i+1,j) Next Next print arrData(3)("姓名") print arrData(9)("数据3") |
下面的是使用和打印的效果。