How to scrape next pages when the selector repeated in pagination?

I use a._1f-eo:last selector for the pagination and I’m not sure how many pages there will be, so I want to click on the next page button to go to the next page until it’s disabled. I think this is how the Agenty works.

The problem is that the next page button has the same class as the previous, or numbered page buttons. So I use the :last CSS selector. but it doesn’t works.

Signup now to get 100 pages credit free

14 days free trial, no credit card required!