I hope JS experts can help me with this one.
I accept a web-page(HTML) using XMLHttpRequest. Then, I want to parse the HTML, so that I can access the DOM tree of the page.
Can anyone help me with this ?
I have tried doing it like :
var data = XHR.responseText;
var myDiv = document.createElement("div");
myDiv.innerHTML = data.replace(/<script(.|\s)*?\/script>/g, '');
Then I try doing things like :