Skip to content

Instantly share code, notes, and snippets.

@Aminadav
Created January 7, 2020 13:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Aminadav/7eb7c6c079ca8eadcc094927d6077c2a to your computer and use it in GitHub Desktop.
Save Aminadav/7eb7c6c079ca8eadcc094927d6077c2a to your computer and use it in GitHub Desktop.
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