Skip to content

Instantly share code, notes, and snippets.

@shadz3rg
Created July 24, 2016 20:12
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 shadz3rg/47b943b65138651885b5aab8af5ba00d to your computer and use it in GitHub Desktop.
Save shadz3rg/47b943b65138651885b5aab8af5ba00d to your computer and use it in GitHub Desktop.
Получить номер продавца со странички мобильной версии Avito
var link = document.querySelectorAll("a.action-show-number")[0];
var href = link.getAttribute('href');
var request = new XMLHttpRequest();
request.open('GET', href + '?async', true);
request.onload = function() {
var data = JSON.parse(request.responseText)
console.log(data.phone);
};
request.send();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment