Html xpath-如何在<;中选择超链接;tr>;基于a<;td>;有一定的内容吗?

Html xpath-如何在<;中选择超链接;tr>;基于a<;td>;有一定的内容吗?,html,dom,xpath,Html,Dom,Xpath,我想在表格行中选择某个超链接。我的链接有两类“mf”和“6day”。我希望能够选择一行,其中有一个以上(现在只有一行是好的),然后移动到第二个锚标记,然后存储链接(storeAttribute) 我有一张这样的桌子: ______________________________________ th | td | role| td | td | td | td | _________________________________________ tr | 6day | a

我想在表格行中选择某个超链接。我的链接有两类“mf”和“6day”。我希望能够选择一行,其中有一个以上(现在只有一行是好的),然后移动到第二个锚标记,然后存储链接(storeAttribute)

我有一张这样的桌子:

  ______________________________________
th |  td   | role|  td |  td |  td | td |
 _________________________________________
tr |  6day | a   | txt | txt | txt | a9 |
tr |  6day | a   | txt | txt | txt | a9 |
tr |  mf   | a   | txt | txt | txt | a1 | <-- the a1 here (2nd anchor link)
tr |  6day | a   | txt | txt | txt | a9 |
tr |  6day | a   | txt | txt | txt | a9 |
______________________________________
第| td |角色| td | td | td | td|
_________________________________________
tr | 6day | a | txt | txt | txt | a9|
tr | 6day | a | txt | txt | txt | a9|

tr | mf | a | txt | txt | a1 |您想要
(//table[@id='practicess']/tbody/tr[td[contains(@class',calendar')and contains(,'sunday-Friday')]//td[@class='''''']/a[@target=''u blank'])[1]
-字面意思是“节点列表的第一项,由所有锚元素组成,并带有一个''u blank'“目标属性包含在任何单元格中,而“从业者”表中包含包含“星期一-星期五”的“日历”单元格的任何行中不包含CSS类。”。如果您要查找所有这样的单元格,只需删除前面的
和后面的
)[1]
您想要的
(//table[@id='practicess']/tbody/tr[td[contains(@class,'calendar')和contains(,'Monday-fy')]]//td[@class='''']/a[@target='u blank']]1]
-字面意思是,“节点列表的第一项由所有锚元素组成,锚元素的目标属性为“_blank”,包含在包含“周一-周五”的“日历”单元格的“从业者”表中的任何行中均不包含CSS类的任何单元格中。”。如果您要查找所有此类单元格,只需删除前导的
和尾随的
)[1]

+1有用,但我不打算查找角色链接(也在tr行上)-它们是第一个“a”-我想要下一个锚,“a1”已更新,以显示如何根据请求查找登录链接单元格。+1很有用,但我不打算使用角色链接(也在tr行上)-它们是第一个“a”-我希望下一个锚点“a1”已更新,以显示如何根据请求查找登录链接单元格。