Last active
December 1, 2022 17:53
-
-
Save rasata/44de909645ccc3e706c18e35e5eb9ee5 to your computer and use it in GitHub Desktop.
Analyze.linkedin.network : This little scrapping is for analyzing linkedin Network from the chrome console.
This file contains hidden or 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
| // Get the Contact List | |
| let contact = $x('//*[@class="reusable-search__result-container "]'); | |
| // Function to save the file | |
| // Function to save the file | |
| (function (console) { | |
| console.save = function (data, filename) { | |
| if (!data) { | |
| console.error('Console.save: No data') | |
| return; | |
| } | |
| if (!filename) filename = 'console.json' | |
| if (typeof data === "object") { | |
| data = JSON.stringify(data, undefined, 4) | |
| } | |
| var blob = new Blob([data], {type: 'text/json'}), | |
| e = document.createEvent('MouseEvents'), | |
| a = document.createElement('a') | |
| a.download = filename | |
| a.href = window.URL.createObjectURL(blob) | |
| a.dataset.downloadurl = ['text/json', a.download, a.href].join(':') | |
| e.initMouseEvent('click', true, false, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null) | |
| a.dispatchEvent(e) | |
| } | |
| })(console) | |
| let csvString=''; | |
| for(let i=0;i<contact.length;i++){ | |
| csvString = csvString + contact[i].innerText.split('\n').join(';') + '\n'} | |
| console.save(csvString,'yourNetwork.csv') | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment