How to scrape both previous and next pagination data?

Hi web scrapers,

I want to scrape both previous and next pagination data.

The problem that I have is when I open the data page that I want to scrape, There is a pagination with both previous and next pagination arrows ('<' and '>') that both are enabled.
And they are not a link. They are just clickable elements.
That means when I click a pagination arrow, the content of the pagination changes, but the URL doesn't change.

So, what I want to do, is to loop through all the pagination content, previous content and next content, in order to scrape all the data.

I can't share informations about the site, but I believe that there is already a solution that solves this kind of pagination problem.

Thank you for understanding.