IOS – `applewebdata` and how to avoid it

automationiossafari

I'm using Workflow on iOS, specifically, an iPad Air 2. Whenever I get the contents of a web page or the links from that input, I notice that all of the links are re-written as

applewebdata://{guid}/the/rest/of/the/path

I'm unable to use this input in the rest of the Workflow, because the steps don't know how to work with applewebdata://

For example, if I get all of the links on a page and try to resolve their content

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

I get an error like

unsupported url

This means I have to do horrible things, like store the scheme and host of the input URL and recombine those with the path from the mangled URL to use more Workflow steps. This is not sustainable!

How do I avoid or work with applewebdata:// URLs?!

Best Answer

The support folks at Workflow replied in an email

Those applewebdata:// URLs are likely local references to the image files that have been downloaded with Get Contents of URL that are now stored in the currently-running workflow. With Get Contents of Web Page, the input page converts the HTML to Rich Text and maintains the web links to each of the images.

The "solution" is to use the Get Contents of Web Page action, then.