2017-09-19 73 views
-4
<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> 

我使用一个电话硒似乎无法一个href点击

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

但这返回一个空字符串

+1

在提出更多问题之前,请阅读[我如何提出一个好问题?](https://stackoverflow.com/help/how-to-ask)。 –

+3

单击链接如何返回空(或不空)字符串?你想要你的脚本做什么?用更多细节描述你的问题(添加异常日志) – Andersson

回答

0

尝试使用XPath

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

是否有任何理由使用这个XPath而不是完全相同的CSS选择器? – Andersson