Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.