Extract URL from email in shortcuts

Looking for a way to extract one specific URL from a HTML email automatically (I receive the exact same email with different URLs many times). Thing is, the URL sits behind an image as a hyperlink, and there are a dozen URLs in the raw HTML. How to extract the one I need?

Tried “Get URLs from Shortcut Input” and then repeat, but no luck.

When using the method you mentioned, do you get urls back or do they not show up? What if you use make HTML from rich text first then get urls from input?

My automation (after trigger) starts with this. Added append to note to check what I get, which is a big pile of letters and numbers, not html or urls

Did you try the make html from rich text method I mentioned?

Yes tried it, but didn’t work (no output). Think because the input is not html, but rather a lot of this

The input should be rich text not html. You need to make it html

Any idea how I should configure? Am working with email content as input (see screenshot above). Don’t known why I get this load of numbers and letters instead of html

You are using make HTML from rich text on the shortcut input (email content), right?

Yes I am

Interesting. I wonder if the email has the images encoded as base64. That’s what the long string of text looks like to me but it’s hard to say without seeing the whole set of text output from the make HTML action

Historical anecdote: one of base64’s original uses was (and is) to send arbitrary data in emails, like attachments (which is why if you attach a 300 KB file to an email, it ends up being a 400 KB message :slightly_smiling_face:

And sometimes the HTML version of an email is sent as an attachment :wink:

1 Like

That is interesting! I wasn’t aware of that until now