我有这个 html 源代码:
<table class="uiInfoTable profileInfoTable uiInfoTableFixed">
<tbody>
<tr>
<th class="label">Birthday</th>
<td class="data">February 4, 1988</td>
</tr>
</tbody>
<tbody>
<tr>
<th class="label">Interested In</th>
<td class="data">women</td>
</tr>
</tbody>
<tbody>
<tr>
<th class="label">Gender</th>
<td class="data">male</td>
</tr>
</tbody>
// etc....
</table>
我想得到所有的值th
,td
它们th
是:生日、感兴趣、关系状态和语言..
我知道它应该是这样的:
elements = driver.FindElements(By.XPath("//a[@class='uiInfoTable profileInfoTable
uiInfoTableFixed']//span[@class='label' and (text()='Birthday' or text()='Intrested
In' or text()='Relationship Status' or text()='Languages')]")).ToList();
任何帮助表示赞赏!