I have made a for each loop to open url and have to take text but in one url the text is on 1 page and in 2 url the text is on 2 page so what can i do now so robot can go to next page and take text

I have made a for each loop to open url and have to take text but in one url the text is on 1 page and in 2 url the text is on 2 page so what can i do now so robot can go to next page and take text