Get the thumbnail from a URL

Hi all ,

I am trying to get the url of a thumbnail from any url.
I easily found out how to do this in google sheet:
=IMPORTXML(B2; F10"//meta[@property=‘og:image’]/@content")

B2 being where the original URL is.

I have now imported my sheet to airtable and am struggling to find a way to do the same. I have been looking at using the XML and HTTP modules, but without luck. I can figure out how to configure them. Any thoughts? Maybe some existing templates or key word I can tray?

The following doesn’t return anything:


XML module:
image
Last airtable module to upload my record (field {json} is a long text)

Thanks in advance for any help

Robin

Welcome to the Make community!

I don’t think you can use XPath Query because the output bundles from your Airtable “Watch Records” module is not a XML document.

1. Output bundles

Please provide the output bundles of the Trigger module by running the scenario, then click the white speech bubble on the top-right of each module, save the bundle contents in your text editor as a bundle.json file, and upload it here into this discussion thread.
Screenshot_2023-10-06_141025

Providing the output bundles will allow others to replicate what is going on in the scenario even if they do not use the external service.

Following these steps will allow others to assist you here. Thanks!

2 Likes

Hi Samliew,
thanks for getting back to me.
I don’t think the input provided by my trigger is the issue. I am simply getting the URL from which I want to extract a thumbnail. But that makes me realise the the XML module maybe doesn’t take a URL as an input.

I had more luck with the scenario using the HTTP module, sceenshot below, but I don’t know how to get the content of the og:image.

To confirm I want to read a URL from airtable as an input, and extract the URL of the thumbnail in another field as an output of this scenario.


image
and here in my output {json} airtable field, it does write, but only the 21. name and 21. value, and they iterate until the last one. not sure how to extract only the one I want. (ofcourse the rest of the plain text in the field is also correctly out put, but not the og:image)

Ah yes, the XML field has to already contain the XML document, and it does not fetch from elsewhere on the internet.

I see you’ve already tried to use the HTTP module to get the web page. You need to get the raw “HTML” first:

Then just map the Data property into the XML field. You may need to trim the whitespace too:

3 Likes

Yay, thanks it makes sense.
Just updated my scenario with this combination of HTTP and XML module and it works exactly as I was hoping. thanks for your help!
Robin

3 Likes