how can I get the file extension of an image when it is not included in the src URL?

I’m working on task automation, so my solution can’t be a manual one. I am moving HTML content from one webpage to another, but I need to get a name list of all images shown on the page. The URLs for the images only have the location down to the folder (e.g. www.whatever.com/abcdefg/archive).

In this case, abcdefg is the name of the image file, but it could be JPG PNG GIF etc. I don’t see anywhere to find that information. If I manually save or drag the image to a folder, then the extension becomes apparent, but I can’t find it without manually interacting with the file.

Ultimately, the user will drag/save the image files out of the HTML page, which can be done fairly quickly, but if they have to go back to the webpage that imported the files and select file extensions, there’s no longer any point in trying to automate the process. It will be too tedious.

I know there are a ton of other ways to get this done, but for this effort, I’m stuck with native JavaScript and HTML only. I can’t access the FSO in native JS, and I can’t use a manual solution like going into the work folder and looking at the files. Anybody? Thanks.

So far, I have not tried anything because I don’t know of any way to do this. Native JS simply does not interact with the FSO.