<a class="page-link" title="Next Page" data-tracking-control-name="nextPageBottom" data-page-number="2" href="/recruiter/smartsearch/history?searchHistoryId=9593411973&searchCacheKey=a2c2df05-f77f-493f-8dae-bc869b6a2451%2CGXJl&searchRequestId=6b3f2672-1089-4677-80b6-f7fa555084f7%2Cr9jK&searchSessionId=9593411973&linkContext=Controller%3AsmartSearch%2CAction%3Asearch%2CID%3A9593411973&doExplain=false&origin=PAGE&start=25" rel="next"><li-icon aria-hidden="true" type="chevron-right-icon"><svg viewBox="0 0 24 24" width="24px" height="24px" x="0" y="0" preserveAspectRatio="xMinYMin meet" class="artdeco-icon" focusable="false"><g class="large-icon" style="fill: currentColor">
<path d="M14,12L8,3.06,9.55,2l6.19,9.15a1.5,1.5,0,0,1,0,1.69L9.55,22,8,20.94Z"></path>
</g></svg></li-icon><span class="hide-a11y">Next Page</span></a>
我需要使用Driver.fund…导航到这个元素。不能使用xpath。有办法吗?html代码中还有许多其他标签。需要使用该标签的属性,使其仅成为该特定标签的唯一标识符。
谢谢,但找到了答案。使用css选择器定位将起作用。
driver.find_element_by_css_selector("#pagination > div > ul > li.next > a")