I want to get the data that is shown in the highlighted Red box and store it in a file. The data is in the AJAX call as highlighted by the red arrow.
So i was wondering is it possible to get that data? If yes then how?
EDIT : I tried the following code given below.
The xhr.response gives the source code of the page which does not contain the data i want and the xhr.responseURL gives the URL of google itself .
var xhr = new XMLHttpRequest();
xhr.responseType = 'text';
xhr.open('GET', 'https://www.google.com.pk/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8#q=real+madrid', true);
xhr.onload = function () {
console.log(xhr.response);
console.log(xhr.responseURL);
};
xhr.send(null);