MacOS – Safari: get URLs of images displayed in Web Inspector

applescriptgoogle-chromejavascriptmacossafari

How do I get the list of the resources loaded in Safari's Web Inspector? (Web Inspector > Resources > Images)

My goal is to download all images shown in the inspector.

These are the manual steps:

  1. open web inspector (CMD + Shift + I; Develop > Show Web Inspector)
  2. click the "Resources" tab
  3. Navigate to your desired resource (fonts, images, scripts, stylesheets)
  4. CMD + double-click the desired resource. This loads your desired image/script/css in a new Safari tab.
  5. close web inspector
  6. copy resource's URL (CMD + L, CMD + C) and close the tab (CMD + T).
  7. repeat for the remaining resources.

I think this should work with JavaScript / AppleScript.

Thanks.

Best Answer

It's a relatively simple task actually. Using Automator app, Just create a new workflow and add these to following actions...

  1. Get current webpage from Safari

  2. Get Image URLs from webpage

    enter image description here