MeEtc wrote a nice tutorial how to do this:
[Tutorial] Communicating with web pages. Take a look at the section "Retrieving content of a web page" before you continue. It's really worth to read it!
The only difference is that you can use the xmlhttp.responseXML property rather than xmlhttp.responseText, as this contains a nice XMLDOM object, ready for you to edit!
Here you have an example on what you can do with it:
code:
var url = "http://stats.enemyterritory.com/profile/paril101?xml=true";
Interop.Call("wininet.dll", "DeleteUrlCacheEntryW", url);
var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
xmlhttp.open("GET", url, true);
xmlhttp.onreadystatechange = function () {
if (xmlhttp.readyState == 4) {
if (xmlhttp.status == 200) {
// Data from URL was retrieved successfully
// You can now use xmlhttp.responseXML
var xml = xmlhttp.responseXML;
Debug.Trace("Engineer XP:"+xml.selectSingleNode("player/xp/engineer").getAttribute("xp"));
} else {
// The server returned an HTTP code other than 200
Debug.Trace("ERROR!");
}
}
}
xmlhttp.send();