Xpath query to find elements which contain a certain descendant

后端 未结 4 410
野性不改
野性不改 2020-12-13 12:39

I\'m using Html Agility Pack to run xpath queries on a web page. I want to find the rows in a table which contain a certain interesting element. In the example below, I wa

4条回答
  •  有刺的猬
    2020-12-13 13:42

    Actually, you need to look for a descendant, not a child:

    //table[@name='important']/tr[descendant::interestingtag]
    

提交回复
热议问题