Skip to content
Advertisement

Selenium / Use pagination on site?

i want to trigger the pagination on this site: https://www.kicker.de/bundesliga/topspieler/2008-09

I found the element with this XPATH in the chrome-inspector:

JavaScript

Now i want to click this element to go one page further – but i get an error.

This is my code:

JavaScript

But i get this error:

JavaScript

How can i go to the next page using selenium?

Advertisement

Answer

The go to the next page you can click on the next page element inducing WebDriverWait for the element_to_be_clickable() and you can use either of the following locator strategies:

  • Using CSS_SELECTOR:

    JavaScript
  • Using XPATH:

    JavaScript
  • Note: You have to add the following imports :

    JavaScript
Advertisement