<root>
// other nodes
<a href="/PatternFramework/Pages/LogOut.aspx?np=/sites/novatestsite/Home.aspx" slick-uniqueid="92">Sign out</a>
</root>
Run Code Online (Sandbox Code Playgroud)
如何编写一个返回包含"logout.aspx" 的a
标签的xpath href
?
比如像
//a[@href[contains[., "logout.aspx"]]
Run Code Online (Sandbox Code Playgroud)
Ser*_*-Tm 22
区分大小写:
//a[contains(@href,'logout.aspx')]
Run Code Online (Sandbox Code Playgroud)
对XPath 2.0不区分大小写:
//a[contains(lower-case(@href),'logout.aspx')]
Run Code Online (Sandbox Code Playgroud)
对XPath 1.0不区分大小写:
//a[contains(translate(@href, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz'),'logout.aspx')]
Run Code Online (Sandbox Code Playgroud)