我正在尝试仅为导航栏的子项查找 xpath。我目前正在尝试的路径//div[@class='navCol subMenus']
来自 HTML 的这种平静。
<div class="PrimaryNavigationContainer">
<div class="PrimaryNavigation">
<div class="Menu">
<div>
<a href="http://www.blah.co.uk/brands.aspx" class="unselectable"><span>Brands</span></a>
<div class="navCol">
<div>
<a class="NoLink unselectable"><span>Shop by Brand</span></a>
<div class="navCol subMenus">
<div>
<a href="http://www.blah.co.uk/blah/catlist_bd4.htm" class="unselectable"><span>blah</span></a>
我尝试了许多 Xpath 语法,但似乎都无法只显示子类别。感谢您提供的任何帮助。