Created
January 7, 2020 13:32
-
-
Save Aminadav/7eb7c6c079ca8eadcc094927d6077c2a to your computer and use it in GitHub Desktop.
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
var list=document.querySelector('.copyable-area').querySelectorAll('.X7YrQ') | |
// var ar=[]; | |
for(let i=0;i<list.length;i++) { | |
var friend=list[i] | |
var phone=friend.querySelector('[tabindex] > div >div:nth-child(2) > div').textContent | |
.replace('+972','0').replace(/[ \-]/g,'') | |
try{ | |
var image=friend.querySelector('img').src | |
} | |
catch (err) { | |
} | |
var name=friend.querySelector('[tabindex] > div >div:nth-child(2) >div:nth-child(2) >div:nth-child(2)').textContent | |
if(!ar.find(x=> | |
x.name==name && x.phone==phone)) { | |
ar.push({image,name,phone}) | |
} | |
} | |
console.log(ar.length); | |
copy(JSON.stringify(ar).slice(1,-1)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment