![](/img/trans.png)
[英]xpath: find a node that has a given attribute whose value contains a string
[英]Find XPath attribute name contains specific string
我有<form data-v-4db188a6="">
標記。 我需要找到僅表單標簽的屬性名稱中包含“數據” ,而不是屬性值! .//form[contains(@prop, 'data')]
不起作用。 可能嗎?
簡短的xpath表達式:
//form/@*[contains(name(), 'data')]
是的,這是可能的:
//form[attribute::*[contains(local-name(), 'data')]]
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.