Skip to content

Instantly share code, notes, and snippets.

@clod81
Last active September 6, 2022 01:20
Show Gist options
  • Save clod81/283d97718e2b202caee3ed6a59626fdc to your computer and use it in GitHub Desktop.
Save clod81/283d97718e2b202caee3ed6a59626fdc to your computer and use it in GitHub Desktop.
jQuery JS LinkedIn company employees' names scraping
// 1. Access a company page on LinkedIn and click on the company employees
// 2. Open the browser dev console
// 3. Import jQuery first (copy and paste jQuery into browser dev console will do)
// 4. Copy and paste the below in the console
// 5. Wait until the last page (10 people per page are displayed)
// 6. Enjoy the list in console output
function scrape(){
jQuery.each(jQuery('span.entity-result__title-line span a span span[aria-hidden="true"]'), function(i,v){
console.log((v.innerHTML.replace(/<!---->/g, "").replace(/ /g, ".")));
});
}
function next(){
jQuery(document).scrollTop(1200);
jQuery('div.artdeco-pagination span.artdeco-button__text').last().click()
}
setInterval(function(){scrape();next()}, 1500);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment