Next Page not opening using Selenium

<li class="item pages-item-next">
<a class="action  next" href="" title="Next">
 <span class="label">Page</span>

Above is the code of HTML, i’m trying to click next page using selenium in python, but it is not clicking. my code is down here:


why i’m getting this error:

Any help would be appreciated.

>Solution :

Root cause:

By.CLASS_NAME,'' – This is incorrect.

By.CSS_SELECTOR, '' This is correct

Try this using XPATH locator:

x = WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.XPATH, "//a[contains(@class,'action  next')]")))


from import By
from import expected_conditions as EC
from import WebDriverWait

Leave a Reply