I would like to get info from multiple pages by clicking through them. The problem is there is not next button and even though the page link contains a number for counting through , as you can see in the image below.
Can anyone help on how to solve this?
Advertisement
Answer
JavaScript
x
9
1
i=2
2
While True:
3
try:
4
#some wait
5
driver.find_element_by_xpath("//a[@class='btn btn-primary spacebutton' and .='{}']".format(str(i+1))).click()
6
i++
7
except:
8
break
9
Just loop through the a tags and click them based on their text.