What I’m trying to do is identify all of the DIVs, on my company’s Home page, that will contain a DFP ad slot. Once I identify all of the DIVs, I’ll check each to see if they contain an iFrame as a child. I’m using xPath to find the initial group of DIVs but I’m getting a different number when using NR versus the correct number when using .Net. I know .Net is correct.
So, I guess I need to know what I’m doing wrong. This is my script. I’m expecting to identify twelve DIVs but am getting twenty-one. I was trying to iterate thru the returned array of found elements, to see the DIV IDs, but can’t seem to do that either (element.id returns ‘undefined’).
// get all of the DIV elements by partial ID
// get a count of the found ad slot DIVs
var eleCt = foundElements.length;
console.log("Ad Slot DIVs Found: " + eleCt);
// iterate thru the foundElements array