Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
假设我有一个包含以下行的表,
... <tr> <th title="Library of Quintessential Memes">LQM:</th> </tr> <tr> <th title="Library of Boring Books">LBB:</th> </tr> ...
我想选择第一个子文本以“L”开头的所有<tr>元素。<th>如何使用 XPath 选择器做到这一点?
<tr>
<th>
使用starts-with功能:
starts-with
//tr[starts-with(th[1],"L")]