I’ve got a list of pages (URLs) in a table. I’d like to get the title (
<title> tag) of each of these pages. Is that possible ?
Welcome to the Community! It is possible but unfortunately, there is no easy way to do this in Grist. One option would be to write a script using the API - check out the link below for more information.
Another way would be through an integration using Apify and Zapier. The article below can help you set up Apify and the initial portion of the Zap. Please note that this method does require a multi-step Zap which is a paid feature in Zapier.
First, you create the webscraper task in Apify then you will need to create a Zap that sends the URL from Grist to Apify. The Trigger would be “New or Updated Record (Instant) in Grist”.
The Action would be “Run Task in Apify”.
Zapier tests your integration along the way so it’ll find any errors and help you resolve them.
The second Zap you would need to create would take the Output from Apify and send it to Grist. The Trigger would be “Finished Task Run in Apify”.
You will need two Action steps but Zapier doesn’t make it easy to connect a search action with an update action. The only way I have found makes you work backwards. Select “Update Record in Grist”.
Then fill out the required fields. You’ll select Team, Document and Table. When you get to the “Record” field, select “Custom” then “Add a Search Step”.
Zapier will now add a “Find Record in Grist” Action before the Update Action.
You’ll set this up to find the URL in Grist that matches the URL in the Apify Output.
After you run a successful test on that action step, the Update Record action will populate the “Record” field with “ID: No Data”
Find the name of the column you wish to populate with the Title and insert data from your first action; “Finished Task Run in Apify”. You will want to include the Output Title here.
Once your initial Zap is triggered and sends the URL to Apify, everything else runs automatically and the Website Title would be populated almost instantly!
Thank you very much for this detailed reply!