Xpath查询 - 尝试定位表中元素的相对路径

时间:2013-11-04 10:44:06

标签: xpath

我正在尝试使用文本'cccc cccc'找到该元素,但无济于事

我试过//[@class='eline']//[contains(.,'cccc cccc')]但无济于事

这是源代码

<tr class="eline">
<tr>
<td class="norm" nowrap=""/>
<td class="norm" nowrap="">
<td class="norm" nowrap="">
<td class="norm" nowrap="">cccc cccc </td>
<td class="norm" nowrap="">99999 </td>
<td class="norm" nowrap=""/>
<td>
<td class="norm" nowrap="">
<td class="norm" nowrap="">
<td class="norm" nowrap="">testcase33 testcase33 </td>
<td class="norm" nowrap="">33100 </td>

1 个答案:

答案 0 :(得分:0)

XPath应如下所示:

//tr[@class='eline']/td[@class='norm' and contains(.,'cccc cccc')]