I have created a python selenium script that should navigate through a website and collect people profiles (https://www.shearman.com/people). The program won't loop through the pages to collect the links. I have used this which doesn't work;
try:
# this is navigate to next page
driver.find_element_by_xpath('//div[@id="searchResultsSection"]/ul/li[12]').click()
time.sleep(1)
except NoSuchElementException:
break
The syntax behind the next button can be seen below;
<a href="" onclick="PageRequest('2', event)" class="xh-highlight">></a>
Does anybody no how to write the code to click the next button?