Scrap all emails with eMacros from a website

This page is to explain how to scrap all emails from many pages.
Lets take this website as example:

This a french website with a plenty of email I would like to scrap using iMacros.

First install iMacros for Firefox

Then Create a new Macro in Javascript.


The code is here:


// settings
var pageBegin = 1;
var pageEnd = 10;
var user = "alan";

//var folderName = "/Users/alan/GoogleDrive/Projets/GooPlus/Projetsencours/agence_immo";
var folderName = "*";
var fileName = pageBegin+"_to_"+pageEnd+"_"+user+"_email_immos.txt";
var urlToGo = "";

for (var page = pageBegin; page < pageEnd; page++) {
  var macro = "CODE:";
  macro += "URL GOTO=" + urlToGo+page+"\n";

  for (var i = 1; i < 11; i++) {
    var macro = "CODE:";
         macro += "TAG POS="+i+" TYPE=A ATTR=CLASS:mailto&&TXT:* EXTRACT=TXT"+"\n";
         macro += "SAVEAS TYPE=EXTRACT FOLDER="+folderName+" FILE=" + fileName;

The iMacro is set as javaScript