关于VB读取网页表格数据 读取网页表格内容,是否可以像读取EXCEL文件那样,可以由纵横定位,比如A3,等等,读取指定CELL?新手求教,谢了 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 没有EXCEL那样编号的。要么你找到TABLE元素后,按通用的方法读他的childNodes属性,要么用那个cells,参考这个js代码function numberCells() { var count=0; for (i=0; i < document.all.mytable.rows.length; i++) { for (j=0; j < document.all.mytable.rows(i).cells.length; j++) { document.all.mytable.rows(i).cells(j).innerText = count; count++; } }} Quote: 引用 1 楼 bcrun 的回复:没有EXCEL那样编号的。要么你找到TABLE元素后,按通用的方法读他的childNodes属性,要么用那个cells,参考这个js代码-----------------------------请教一下,网页的源代码部分如下: <tr align="center" bgcolor="#4E6815" class="style31"> <td width="23" height=22 bgcolor="#85AB3D">选</td> <td width="60">类型</td> <td width="51">时间</td> <td width="115">主队</td> <td width="43" height="16">主</td> <td width="43">和</td> <td width="43">客</td> <td width="45">主胜率</td> <td width="45">和率</td> <td width="45">客胜率</td> <td width="45">返还率</td> <td width="115">客队</td> <td width="58">详情</td> </tr> <tr align='center'><td height='22' colspan='14' bgcolor='#DAEAF5'><b>12月31号 星期二 威廉希尔(英国) </b></td></tr> <tr align="center" id="tr_1" name="273,1" bgcolor="#ffffff" height="18"> <td rowspan="2"><input name='checkbox' id=input_1 type="checkbox" onClick=matchshowhide(this) value=1 checked></td> <td rowspan="2" bgcolor=#FF7000 class="style31"><a href='http://info.bet007.com/cn/SubLeague.aspx?SclassID=273' target=Blank style='color:white'>澳洲甲</a></td> <td rowspan="2" class="en" >13-12-31<br>15:00</td> <td rowspan="2" class="team"><a href="http://info.bet007.com/team/2910.htm" target="_blank">中部海岸海员</a></td> <td class="en" onClick="OddsHistory('35185105&company=威廉希尔(英国)&r1=中部海岸海员&r2=珀斯光荣')" style="cursor:hand">1.67</td> <td class="en" onClick="OddsHistory('35185105&company=威廉希尔(英国)&r1=中部海岸海员&r2=珀斯光荣')" style="cursor:hand">3.40</td> <td class="en" onClick="OddsHistory('35185105&company=威廉希尔(英国)&r1=中部海岸海员&r2=珀斯光荣')" style="cursor:hand">5.00</td> <td class=en>54.79%</td><td class=en>26.91%</td><td class=en>18.30%</td><td class=en>91.50%</td> <td rowspan="2" class="team"><a href="http://info.bet007.com/team/2913.htm" target="_blank">珀斯光荣</a></td> <td rowspan="2" class="gocheck" align="left"><a href='Oddslist/921600.htm' target="_blank">查看</a>(248)</td> </tr> <tr align="center" id="tr2_1" bgcolor="#ffffff" height="18" class="en"> <td bgcolor='#DCFFB9' class='en'>1.57</td><td bgcolor='#FFD0E8' class='en'>3.50</td><td bgcolor='#FFD0E8' class='en'>6.00</td> <td class=en>58.47%</td><td class=en>26.23%</td><td class=en>15.30%</td><td class=en>91.80%</td> </tr>,我想根据主队的名字,比如这里的: 中部海岸海员,来读取它后面的二排数据:红色的部分 请问一下最简单的方法多谢! 其实这个有那js代码参考后也没啥好说的了啊,是苦力活。你自己肯定要先找到这些tr所在的table的id属性,也就是对应那个mytable,然后自己找到那些TR,TD的内容啊。在VB6中用webbrowser控件处理那网页的话,对应的就是webbrowser1.document.all.mytable 用WINSOCK下载文件时,怎么判断已经下载完成? 路由端口映射被屏蔽 下面这段保存图片的代码怎样引用? 哪位提供个VB调用串口通讯dll的例子 取不重复的随机数 EnumWindows 怎么等待它的回调执行完成? 是异步的. 一个远古以来在CSDN上还没人回答出来的问题!!!能给出源码者500分相送!!!! 有没有VB的反编译软件啊?谢谢 如何读写二进制文件? 求助:如何在自己的程序里控制其它应用程序,主要实现对另一应用程序的鼠标定时自动单击 VSflexgrid求助,急!!拜谢。 串口接收数据问题
function numberCells() {
var count=0;
for (i=0; i < document.all.mytable.rows.length; i++) {
for (j=0; j < document.all.mytable.rows(i).cells.length; j++) {
document.all.mytable.rows(i).cells(j).innerText = count;
count++;
}
}
}
webbrowser1.document.all.mytable