Skip to content

Instantly share code, notes, and snippets.

@shcallaway
Created June 7, 2021 03:27
Show Gist options
  • Save shcallaway/f6c6d42794dc8da5823e47673d33a160 to your computer and use it in GitHub Desktop.
Save shcallaway/f6c6d42794dc8da5823e47673d33a160 to your computer and use it in GitHub Desktop.
Create CSV of LinkedIn people search results
// Here's a quick script you can copy-paste into your browser console to copy a CSV of people search results from LinkedIn
// Example: https://www.linkedin.com/search/results/people/?currentCompany=%5B%223282%22%2C%2236494%22%2C%222142019%22%5D&geoUrn=%5B%22103644278%22%5D&origin=FACETED_SEARCH&profileLanguage=%5B%22en%22%5D&title=sales%20rep
var contentStrings = Array.from(document.querySelectorAll('.entity-result__content')).map(node => node.innerText)
var tuples = contentStrings.map(function(contentString) {
var split = contentString.split("\n")
return [split[0], split[split.length-2], split[split.length-1]]
})
var joinedTuples = tuples.map(function(tuple) {
return tuple.join("|")
})
var csv = joinedTuples.join("\n")
copy(csv)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment