开发者

How to identify in table an input (check-box) followed by a text in <td>?

I have to identify the path of check boxes in a row from a table using the text preceding them. The problem is that the text is inserted in a 'td'.

The code is following:

<tr class="bz_row_even"> <td align="center"> <input type="checkbox" name="email-0-10" value="1" checked> </td> <td align="center"> <input type="checkbox" name="email-1-10" value="1" checked> </td> <td align="center"> <input type="checkbox" name="email-2-10" value="1" checked> </td> <td align="center"> <input type="checkbox" name="email-3-10" value="1" checked> </td> <td>A new bug is created </td> </开发者_如何学编程tr></code></pre>

In this example I have 4 check-boxer for a row. My query should be with a count to check the check-boxes in turn. Could somebody help me with the path of check-boxes?

Thank you in advance


If you don't use Se-IDE, this becomes much easier. Here I just add the path to a list, but could use get_attribute or similar on the element that is been used.

paths = []
for checkbox in range(se.get_css_count("css=#bz_row_even input"):
    paths.append("css=#bz_row_even input[%d]" % checkbox)

Unless I completely misunderstand your question

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜