WatiN - 查找 HTML 表格 [英] WatiN - Find HTML Table

查看:31
本文介绍了WatiN - 查找 HTML 表格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 WatiN 在表中获取 TD 的值.问题是我无法通过 Id 选择表(因为它丢失了)并且三个表具有相同的 CSS 类:

I´m trying to get the values of TDs inside a table using WatiN. The problem is that I´m not able to select a table by Id (because it´s missing) and three tables have the same CSS class:

table class='tablePpal' width='100%' cellspacing='2' cellpadding='1' border='0'

table class='tablePpal' width='100%' cellspacing='2' cellpadding='1' border='0'

table class='tablePpal' width='100%' cellspacing='2' cellpadding='1' border='0'

table class='tablePpal' width='100%' cellspacing='2' cellpadding='1' border='0'

table class='tablePpal' width='100%' cellspacing='2' cellpadding='1' border='0'

table class='tablePpal' width='100%' cellspacing='2' cellpadding='1' border='0'

我需要选择第二个表 TD.我试过了:

I need to select second table TDs. I tryed:

Table _table = browser.Table(Find.ByClass("tablePpal"));

Table _table = browser.Table(Find.ByClass("tablePpal"));

不幸的是,该代码不返回表的集合,只返回找到的第一个.如何选择第二个表?

Unfortunately that code does not return a collection of tables, only the first one found. How can I select the second table?

谢谢!

推荐答案

browser.Table(Find.ByClass("tablePpal") && Find.ByIndex(1))

这篇关于WatiN - 查找 HTML 表格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆