The <img> tags are in another document in the frame.
First enable the right frame object in the main document. If you have a name for the frame, do the following:
var frame = document.querySelector("frame[name='NAME']");
If you do not name your frames, you will need to index the frame in the array of frames returned by document.getElementsByTagName('frame');
To access all the images in a document that you can take:
frame.contentDocument.images
or
frame.contentDocument.getElementsByTagName("img")
source share