PhantomJS downloading many sites starts to copy same site after first few downloads
<p>This code continues to download the same site on a loop from a list of thousand pages. Couldn't find any way around it. What I googled it might be a problem with split.</p>

<pre><code>var fs = require('fs');
var pageContent = fs.read('list.txt');
var arrdata = pageContent.split(/[\n]/);
var system = require('system');
var page = require('webpage').create();
var args = system.args;
var imagelink;
var content = " ";

function handle_page(i){
    var imageLink = arrdata[i];
    page.open(imageLink, function(){
        fs.write("file"+i+".txt", page.content, 'w');
        handle_page(i+1);
    });
}
handle_page(0);
</code></pre>