How do I download all PNGs on a page with iOS Workflow?

I want to save all of the PNGs from this goofy website so I can turn them into a PDF. I thought I'd use Workflow for iOS, which I've never used before.

I get the contents of this page and then get all the links

Get Contents of URL
|> Get URLs from Input
|> Quick Look

But, when I want to filter or match those URLs for PNGs, I get weird applewebdata:// URLs, like

applewebdata://{guid}/path/to/PNG

I am currently using iOS and trying to make Workflow (or something similar) work for this task. Thanks for the other suggestions, but they won't work for me!


You're so close! The key missing piece here is using the Get Contents of Web Page action instead of Get Contents of URL. If you simply swap that action in, everything should work as you were expecting it to, and you can use the simpler solution you referenced in your answer.

Here is a working example:

Get Contents of Web Page
|> Get URLs from Input
|> Get Contents of URL
|> Filter Images Where: File Extension is 'png', Sort by Name, Order A to Z
|> Make PDF
|> Set Name: Workflow Input Name
|> Quick Look
|> Save File

What a hot mess... I ended up using a number of "Get Component of URL" steps to extract the scheme and host from the Workflow Input and the path from the links to PNGs on the page (these were the ones showing as applewebdata://).

Once I had the parts of the URL to download, it went something like this

Get Contents of URL
|> Get Component of URL; Scheme
|> Save Variable 'Scheme'
<Input>
|> Get Component of URL; Host
|> Save Variable 'Host'
<Input>
|> Get URLs from Input
|> Repeat with Each
   |> If Input Contains '.PNG'
   |> Get Component of URL; Path
   |> URL <Scheme>://<Host>/<Path>
   |> Get Contents of URL
   |> Add to Variable 'Pages'
|> Pages
|> Filter Images; Sort by Name A to Z; File Type 'PNG'
|> Make PDF
|> Set Name <input.Name>
|> Quick Look
|> Save File

It seems like, if I didn't have to break down into procedural steps to extract and recombine a usable URL, I could have written a much cleaner simpler pipeline. Something like

Get Contents of URL
|> Get URLs from Input
|> Get Contents of URL
|> Get Images from Input
|> Filter Images; Sort by Name A to Z
|> Make PDF
|> Set Name <input.Name>
|> Quick Look
|> Save File