I am trying to list all of the elements on a website for a autofill feature.
One of the first steps is to list all of the elements that a user can interface with. So it is important to look at each element.
I would like to return a 2-dimensional array to vb.net, how can I implement this javascript code with evalscript to
return the array?
Quote:
if (document.all !== undefined) {
allElements = document.all;
} Else {
allElements = document.getElementsByTagName("*");
}
var myArr = new Array();
var r = 0;
for (var i=0, max=allElements.length; i < max; i++) {
switch (allElements[i].nodeType) {
case "a": myArr[r] = new Array(allElements[i].nodeType,allElements[i].getAttribute("href"));
case "button": myArr[r] = new Array(allElements[i].nodeType,allElements[i].getAttribute("href"));
}
r++
}
return myArr;