0

Here is an excerpt of my xml:

<div class="0001">
    <label title="Label1">Label1:</label>
</div>
<div class="0002">
    <input type="text">
</div>

I know how to select the "Label1" label. I need to select an input of text type. Class names are generated in a random way and changes after each session. So it's only possible to refer to label title and an input type

4

1 回答 1

2

尝试:

'//div[label[@title="Label1"]]/following-sibling::div/input[@type="text"]'

选择一个<div>包含一个<label>本身具有titlevalue 属性的a ,然后在这个前者的兄弟姐妹中Label1寻找一个<input>带有type“文本”的<div><div>

于 2013-08-06T09:29:41.153 回答