我正在尝试查找元素的父元素。我尝试使用xpath'..','。/ ..'、. parent等。我在网上找到的所有解决方案都以某种方式为我提供了其他一些相似元素的父级。请帮忙。
<div ng-repeat="menu in category.refineDynList" ng-if="menu.removableOptions.length || menu.availableOptions.length" class="">
<a class="left-sidebar__header" href=""><span>Category</span></a>
<div class="left-sidebar__category-container">
<!-- ngIf: menu.showMore -->
<refine-search ng-if="menu.showMore" link="menu.showMore.link" label="menu.showMore.label" class="">
<div class="left-sidebar__search-container">
<input type="search" class="left-sidebar__search ng-pristine ng-untouched ng-valid" ng-model="search.label" ng-click="handleSearchClicks()" placeholder="Show More Refinements..."><!-- ngIf: showRefinements -->
</div>
</refine-search>
<!-- end ngIf: menu.showMore --><!-- ngRepeat: option in menu.removableOptions --><!-- ngRepeat: option in menu.availableOptions -->
</div>
</div>
我的代码是:
parent_element = header_element.find_element_by_xpath('..')