0
我想要得到一個包含單詞「com」的文本,但是要包含單詞「blog」,但要包含而不是。這兩個條件是否可以合併?是否可以在Xpath中結合contains()函數?
例如:
<html>
www.games.com
www.gamerblog.com
www.sports.com
</html>
結果= [www.games.com,www.sports.com]
我想要得到一個包含單詞「com」的文本,但是要包含單詞「blog」,但要包含而不是。這兩個條件是否可以合併?是否可以在Xpath中結合contains()函數?
例如:
<html>
www.games.com
www.gamerblog.com
www.sports.com
</html>
結果= [www.games.com,www.sports.com]
使用邏輯NOT與邏輯AND有兩個分開contains
呼叫:
contains(., "com") and not(contains(., "blog"))
我已經嘗試了邏輯和和符號,但在一個函數中包含。 – CodeCraft