What is the correct XPath for choosing attributes that contain “foo”?

后端 未结 9 1611
予麋鹿
予麋鹿 2020-11-27 11:15

Given this XML, what XPath returns all elements whose prop attribute contains Foo (the first three nodes):


 

        
9条回答
  •  爱一瞬间的悲伤
    2020-11-27 12:05

    If you also need to match the content of the link itself, use text():

    //a[contains(@href,"/some_link")][text()="Click here"]

提交回复
热议问题