我可以找到textA
,但我需要找到该行中的复选框。所以我的想法是为tr
找到textA
,然后在tr
下搜索元素复选框。任何人都可以帮我详细说明XPath查询吗?
<tbody class = "table">
<tr class ="rows">
<td class= "colmn">
<div class = "textA">
<td class= "colmn">
<div class = "image">
<td class= "colmn">
<div class = "drop down">
<td class= "colmn">
<div class = "checkbox">
<tr class ="rows">
<td class= "colmn">
<div class = "textC">
<td class= "colmn">
<div class = "image">
<td class= "colmn">
<div class = "drop down">
<td class= "colmn">
<div class = "checkbox">
答案 0 :(得分:1)
这个XPath,
//tr[td/div/@class='textA']/td/div[@class='checkbox']
将根据要求选择div
中class='checkbox'
tr
td/div
class='textA'
setState
。{/ p>
答案 1 :(得分:0)
您可以尝试: - //div[@class="textA"]/ancestor::tr//*[@class="checkbox"]