Created
July 24, 2016 20:12
-
-
Save shadz3rg/47b943b65138651885b5aab8af5ba00d to your computer and use it in GitHub Desktop.
Получить номер продавца со странички мобильной версии Avito
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
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