try:
next_page_elem = self.browser.find_element_by_xpath("//a[text()='%d']" % pageno)
except noSuchElementException:
break
print('page ', pageno)
next_page_elem.click()
sleep(10)
I have a page contains information about reports inside a frame. When i use sleep method to wait for next page to load it works, and without it i kept getting the information on page 1. Beside the sleep is there a better to do this in selenium. I have tried out some previous post that is similar but i think the html i have is quite unique please see example below. Selenium Python: how to wait until the page is loaded? Any help I would be much appreciated. Thanks
<html>
<div class="z-page-block-right" style="width:60%;">
<ul class="pageingclass">
<li/>
<li>
<a class="on" href="javascript:void(0)">1</a>
</li>
<li>
<a onclick=" gotoPage('2','2')" href="javascript:void(0)">2</a>
</li>
<li>
<a class=" next " onclick=" gotoPage('2','2')" href="javascript:void(0)"/>
</li>
</ul>
</div>
</html>