I use Javascript with PhantomJS.
I know my DOM contain many attribute like foo_0, foo_1, …
I know I can access them with (I test it, It's work)
window.foo_1.src
window['foo_1'].src
I would like iterate to access all attributes. Something like this:
var i = 0
do {
// some stuff
bar = page.evaluate(function(){
return window['foo_' + i].src
})
i++
} while ( <cond> )
'foo_1' work fine but 'foo_' + i don't.
Do you have any idea ? I seems not know.