-
-
Save kevinrodbe/427f3e3ec3ca976a319a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var scrapurl = []; | |
$("a[target=_blank]").not(".btn").each(function(){ | |
var $yo = $(this); | |
scrapurl.push($yo.attr("href")); | |
}) | |
singleScrap(scrapurl,0); | |
var conseguidos = ""; | |
function singleScrap(scrapurl,ind){ | |
if(scrapurl[ind]){ | |
console.log(scrapurl[ind]); | |
$.ajax({ | |
url: scrapurl[ind], | |
success: function(data) { | |
var pattern = /[a-zA-Z0-9]{2,3}\.+[a-zA-Z0-9]+@[a-zA-Z0-9\._\-]+/i; | |
var codhtml = data; | |
var res= codhtml.match(pattern); | |
if(res && res.length>0){ | |
for(enc=0;enc<res.length;enc++){ | |
//console.log(res[enc]); | |
conseguidos = conseguidos+ res[enc]+", "; | |
} | |
} | |
}, | |
complete: function(){ | |
singleScrap(scrapurl,ind+1); | |
} | |
}); | |
} else { | |
console.log(conseguidos); | |
return false; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment