Created
January 14, 2020 16:44
-
-
Save iitsuraj/8f86e56af0f1e75b48d7848fabd03f48 to your computer and use it in GitHub Desktop.
Linkedin E-mail Scraper
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
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