title: NodeJS x-ray web-scraper:multiple urls in a loop callback
body: <p>im using x-ray, which is great but lack of tutorial. anyway, I use an array of urls named urls. In the loop ,each url fetched and return result through callback. in the callback function i need to know what was the url which was parsed. How can i know which url is returning if the callback returns only err and results? (is it really an x-ray question or js)</p>
  
  <pre><code> xrayRamiLevy = function(){
    var index = 0;
    for (index; index &lt; urls.length; index++){
     x(urls[index].url, '.product_item',
    [{
        title : '.prodDescDiv h3',
        description : '.prodBrand',
        imageUrl : '.image_icons_zone .image img@src',
        onclick : '.image_icons_zone .image a @onclick',
    }]
  )
  (function(err, results){
      for (var i = 0; i &lt; results.length; i++){
  
        var s = results[i].onclick.substr(0, results[i].onclick.lastIndexOf("'"));
        s = s.slice(s.lastIndexOf("'") + 1);
        results[i].catalogueNumber = s;
        delete results[i].onclick;
        if (results[i].description !== undefined &amp;&amp; results[i].description.length &gt; 0)
        s = results[i].description.replace(/\s+/g, ' ').trim();
        results[i].description = s;
  
        if (urls[index].category !== undefined &amp;&amp; urls[index].category.length &gt; 0)
        results[i].categoriesIds = urls[index].category;
  
        if (urls[index].subcategory !== undefined &amp;&amp; urls[index].subcategory.length &gt; 0)
        results[i].subcategoriesIds = urls[index].subcategory;
  
      }
      fs.writeFile("./results.json", JSON.stringify(results, null, '\t'));
  });
  </code></pre>
  
  <p>}
   }</p>