How to get previous row number of html table

I have a html table. The table have dynamic rows.

For an example:

Rows of the table have 1000 lines
I scraped the table
So scraped data table have 1000 row number.
I check the table row using loop by their row number from scraped datatable.
If row number 47 have matching, then the row number 47 will disappear from the html table.
So the html table will have 999 rows .
Thus row number 48, will become new row number 47.
But my next iteration will be row number 48 so I cannot check the new row number 47.
How I can start back my row number loop with previous number which is row number 47.
Is there any suggestion for me to put any indicator?

Thanks

Hey @mashy2,

Keep the row no in a variable and initialize the loop variable with the row no variable at the end of loop before the next iteration.