Instead of making n, you could use enumerate() on the source.urls() at the top of the loop.