Selenium似乎无法点击href链接

时间:2017-09-19 05:13:26

标签: python selenium hyperlink

<a class="page-link" title="Next page" data-page-number="3" href="/recruiter/smartsearch?searchHistoryId=1702735186&amp;searchCacheKey=1fdcde45-657b-4666-824a-12ab561b3a91%2Cm9d5&amp;searchRequestId=d371cf7e-2703-43de-9fe5-218fad50e152%2C5wG7&amp;searchSessionId=1702735186&amp;linkContext=Controller%3AsmartSearch%2CAction%3Asearch%2CID%3A1702735186&amp;doExplain=false&amp;start=50" rel="next">
   <svg aria-hidden="true">
       use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#chevron-right-icon" data-size="small"></use></svg><span class="hide-a11y">Go to page 3</span></a>

我正在使用

的电话
driver.find_element_by_css_selector('a[title="Next page"]').click()

但这会返回一个空字符串

1 个答案:

答案 0 :(得分:0)

尝试使用xpath

//a[@title='Next page']