Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想知道如果我有这个 div 标签
<div class="class1 class2 class3" > some stuff </div>
那么如果我提到这个//div[@class='class2']
//div[@class='class2']
它会找到它还是只找到单个类
这已经被问过,但你应该使用:
//*[contains(concat(' ', normalize-space(@class), ' '), ' class2 ')]
注意有一些用于评估 xpaths的在线工具