Ok,
for example you have a list URLS.txt file.
So first step you get this url from file as I mentioned before - take one line with removing from URLS.txt
Then go to this url, then other actions of this template.
Because of taking lines with removing you'll visit all the pages one by one. And it'll be finished when there is none line in file.
If somthing isn't clear - my skype is open to reply on your questions guys.