I want to click on the Next-button at https://free-proxy-list.net/. The XPATH selector is //*[@id="proxylisttable_next"]/a
I do this with the following piece of code:
element = WebDriverWait(driver, 2, poll_frequency = 0.1).until
(EC.visibility_of_element_located((By.XPATH, '//*[@id="proxylisttable_next"]/a')))
if (element.is_enabled() == True) and (element.is_displayed() == True):
element.click()
print "next button located and clicked" # printed in case of success
Subsequently, I get all the IPs from the table like this:
IPs = WebDriverWait(driver, 2, poll_frequency = 0.1).until
(EC.presence_of_all_elements_located((By.CSS_SELECTOR, ':nth-child(n) > td:nth-child(1)')))
Although the CSS_selector is the same for all tabs, and although I get a next button located and clicked, the IPs output is the same for both tabs (i.e. it seems like the Next-button never was clicked). Additionally, there is no Exception thrown.
Therefore, there must be something fundamentally wrong with my approach.
How to click on visible & enabled buttons correctly in phantomJS using python/selenium?
For your understanding, here is the html of the page section I am referring to:

driver.execute_scriptJs will do it for you.