The amount of data(number of pages) on the site keeps changing and I need to scrape all the pages looping through the pagination.
Website: https://monentreprise.bj/page/annonces
Code I tried:
xpath= "//*[@id='yw3']/li[12]/a"
while True:
next_page = driver.find_elements(By.XPATH,xpath)
if len(next_page) < 1:
print("No more pages")
break
else:
WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.XPATH, xpath))).click()
print('ok')
ok is printed continuously
