Skip to content

Instantly share code, notes, and snippets.

@iitsuraj
Created January 14, 2020 16:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iitsuraj/8f86e56af0f1e75b48d7848fabd03f48 to your computer and use it in GitHub Desktop.
Save iitsuraj/8f86e56af0f1e75b48d7848fabd03f48 to your computer and use it in GitHub Desktop.
Linkedin E-mail Scraper
function extractEmails(text) {
return text.match(/([a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+\.[a-zA-Z0-9_-]+)/gi);
}
function randomIntFromInterval(min, max) {
// min and max included
return Math.floor(Math.random() * (max - min + 1) + min);
}
function CommentProcess() {
if (
document.getElementById("show_prev") === null ||
document.getElementById("show_prev") === undefined
) {
clearInterval(getAllComment);
console.log("All comment fetched");
console.log("Email Scraping Started...");
console.log("data copied complete");
alert("data copied complete");
alert("check your console");
extractEmails(document.body.innerText);
} else {
document.getElementById("show_prev").click();
window.scrollTo(0, document.body.scrollHeight);
}
}
const getAllComment = setInterval(function() {
CommentProcess();
}, randomIntFromInterval(5000, 10000));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment