XPath to select a table row that has a cell containing specified text

后端 未结 2 486
情深已故
情深已故 2020-12-24 01:39

How do I select a table row that has a cell containing specified text with XPath?

2条回答
  •  北海茫月
    2020-12-24 02:26

    Use:

    ExpressionSelectingTable/tr[td//text()[contains(., 'targetString')]]
    

    This means:

    Select every tr that is a child of any table selected by the expression ExpressionSelectingTable and that (the tr) has at least one td child that has at least one text-node descendent that contains the string 'targetString'

提交回复
热议问题