我想從下面的html中獲取屬性「值」的值。我知道的唯一值是<b>
標籤。名稱和值根據<b>
標籤不斷變化。如何找到硒的值
<input type="hidden" name="expressions[1].checked"/>
<input type="hidden" value="B" name="expressions[1].expressionLabel"/>
<b>Description</b>
<input type="hidden" value="Description" name="expressions[1].parameterName"/>
<input type="hidden" value="Description" name="expressions[1].fieldName"/>
<input type="hidden" value="RF" name="expressions[1].fieldType"/>
<input type="hidden" value="" name="expressions[1].limitedValues"/>
<input type="hidden" name="expressions[0].checked"/>
<input type="hidden" value="A" name="expressions[0].expressionLabel"/>
<b>Create Date</b>
<input type="hidden" value="StartCreateDate" name="expressions[0].parameterName"/>
<input type="hidden" value="CreateDate" name="expressions[0].fieldName"/>
<input type="hidden" value="RF" name="expressions[0].fieldType"/>
<input type="hidden" value="" name="expressions[0].limitedValues"/>
<tr>
<td colspan="4">
<table width="100%" cellspacing="0" cellpadding="4" border="0">
<tbody>
<tr>
<td class="bb" align="left" colspan="4">
<div id="criteria_table">
<meta content="text/html; charset=utf-8" http-equiv="Content-Type"/>
<table width="100%" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td class="pad s_pad_right">
<table id="criteria_items" class="table_form_advanced" width="100%" cellspacing="0" cellpadding="4" border="0">
<tbody>
<tr>
<td>
<div>
<div>
<table>
<tbody>
<tr>
<td width="150" valign="top">
<input type="hidden" name="expressions[0].checked"/>
<input type="hidden" value="A" name="expressions[0].expressionLabel"/>
<b>Description</b>
<input type="hidden" value="Description" name="expressions[0].parameterName"/>
<input type="hidden" value="Description" name="expressions[0].fieldName"/>
<input type="hidden" value="RF" name="expressions[0].fieldType"/>
<input type="hidden" value="" name="expressions[0].limitedValues"/>
</td>
<td width="120" valign="top">
<select class="FormSelect" title="Operator" name="expressions[0].operationName">
<option selected="" value="contains">contains</option>
<option value="does not contain">does not contain</option>
</select>
</td>
<td valign="top">
<input class="FormSelect" type="text" title="Description" value="" name="expressions[0].values" maxlength="255" size="20"/>
</td>
</tr>
</tbody>
</table>
</div>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
我想字符串值= driver.FindElement(By.XPath(「// B [文本()= '說明'] /preceding-sibling::input[1]")).GetAttribute("value「);它的工作。謝謝 – Leo