How to count rows in DataTable?

Hi, I got an issue with the multiple pages. I can scrape the data and loop it through. But i cannot click on the required destination as the data is in three page. The click should go in the 2nd page of the website and click on the required patient destination details.