[英]How to get the HTML TD sibling following (the TD whose child table has a TD whose span i got)?
我有一个td( id=opdBrowser:todaysPatientsTable:5:j_id556
)有一个表( class=panelGrid
)有我想要的条件。 现在我需要走出表并转到锚id="opdBrowser:todaysPatientsTable:5:createQueueNoLinkId"
这是在对TD id="opdBrowser:todaysPatientsTable:5:j_id675"
当我处于表的td范围内并且需要离开表并获取下一个td时,XPath是什么?
相关的HTML在这里:
<td id="opdBrowser:todaysPatientsTable:5:j_id556" class="rich-table-cell alignAndWrap ">
<table class="panelGrid" width="100%" cellspacing="2" cellpadding="2" border="0">
</td>
<td id="opdBrowser:todaysPatientsTable:5:j_id675" class="rich-table-cell alignAndWrap ">
<a id="opdBrowser:todaysPatientsTable:5:createQueueNoLinkId" title="Create Encounter">
如果需要升级,可以使用..
,例如:
//table[@class="panelGrid"]/../../td[a/@title="Create Encounter"]
会在与您的第一个所选table
相同的table
选择包含标题为“创建遇到”的链接的td
。
如果您确实想要以下同级,而不选择某些条件下所需的同级,则也可以
//td[table/@class="panelGrid"]/following-sibling::td
它能回答您的问题吗?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.