I have a embed code from instagram, that inserting a photo on my page, then I need to select the image src of this photo with querySelector from my JS-plugin connected to page
But when I try to make selections with JS there are no results after page loaded.
document.getElementsByTagName('img');
> HTMLCollection [img.sarafan-pixel]
I try
document.querySelectorAll('img');
document.getElementsByTagName('img');
And there are no images from insta...
But then i goes to Elements in devtools and click on it with selector tool, find this code in DOM and go back to console, there are some results for this img, what a strange behavior?
document.getElementsByTagName('img');
> HTMLCollection(5) [img, img.EmbeddedMediaImage, img, img, img]
May be there are another ways to get src of instagram photo embedded on page?