How to get all of image elements?

I wanna get all of image elements by document.getElementsByTagName('img'), but I only get a few. When I scroll to the end, I can get more image elements.

It looks like that Obsidian may lazy load elements.

How can I get them? Thanks!

You could access the embeds in the file’s metadata cache and scan for the extensions you want.

Many thanks! I could get all image files by metadataCache, but I cannot know which one of image is what I click.
For example, I have two same images in my article, and I can get all image files through metadataCache. The two image files that I get from metadataCache have same information. I can’t know which one of the two same images is what I click.