I would propose you make a generic loop start with an Variable Condition Loop End.
inside of this, you first construct the URL as ...page-num=Currentiteration+1
Than you check if this page exists. If this is not working the the KREST nodes, you can also pack them into a try catch construct.
Last, you end the loop if you found a non exisiting page.
You can also take a look at our forum example on our example server. 50_Applications/_07_ForumAnalysis There we do this similarly, but we "know" the last page because of the last button of the forum.