Members-only tutorial
Watch the video and get the practice sheet with membership.
About this Tutorial
Featured Formulas
Video Transcript
<div> Hey, Zunaid, you asked how would I do the following? In Google Sheets, it's in column A I have a list of URLs. For each of those URLs, I want to pull that URL's featured image Learn how to use images in Google Sheets with functions like IMAGE and IMPORTXML. Opens in new tab and meta description, and put those in columns B and C. Here's how you do it. I just grabbed Wikipedia articles for this example.<br><br>You'll see every webpage is d. And I got the title programmatically with import Discover how to import data from various sources into Google Sheets. Opens in new tab xml. I got the image Learn how to use images in Google Sheets with functions like IMAGE and IMPORTXML. Opens in new tab here with import Discover how to import data from various sources into Google Sheets. Opens in new tab XML and the function Understand how to create and use functions in Google Sheets for better data manipulation. Opens in new tab or formula Get familiar with the syntax rules for writing formulas in Google Sheets. Opens in new tab image Learn how to use images in Google Sheets with functions like IMAGE and IMPORTXML. Opens in new tab . And then I got a meta descript or some type of description. You'll see.
That Wikipedia articles don't have a meta description, but you'll see why soon.<br><br>So how did I do this? Let's let's copy this and I'll just show you from the beginning. If you already can tell how to do this, then you don't have to watch the rest of this video. But I'm just gonna go step by step on how to do this. For you. So here we have just the U URLs and then we wanna get the title first, which is pretty simple.<br><br>Title's, pretty simple. Image Learn how to use images in Google Sheets with functions like IMAGE and IMPORTXML. Opens in new tab is not as simple.
And meta description is similarly, not as simple, but you'll see how to do it and you'll be able to then riff on it as much as you want. So let's go to SpaceX Wikipedia, that page. So this is this link. You can. See this is the same link. What I want to do is I actually wanted Tori right click view page source.<br><br>So that's over here. And this is the source. This will tell us how to get the information we want. So we want the title. It is literally title.
So all we have to do is use import Discover how to import data from various sources into Google Sheets. Opens in new tab xml, which is generally how you use, how you capture HTML data Explore different types of data you can work with in Google Sheets. Opens in new tab because there is the import Discover how to import data from various sources into Google Sheets. Opens in new tab html function Understand how to create and use functions in Google Sheets for better data manipulation. Opens in new tab , but it imports as you see here.<br><br>It imports data Explore different types of data you can work with in Google Sheets. Opens in new tab from a table Learn how to create and manage tables in Google Sheets for organized data. Opens in new tab or list on an HTML page. What we really want to import Discover how to import data from various sources into Google Sheets. Opens in new tab xml. And then the URL is gonna be A two, which is over here on. To the left, the XPath query Understand XPath queries to extract specific data from XML documents. Opens in new tab this, the title one's pretty simple. It's just title, slash title. And if you get it right on the first go, it'll tell you what it is here.<br><br>And that's it. That's the title. So we can grab that and copy and paste that formula down here.
And we have the title image Learn how to use images in Google Sheets with functions like IMAGE and IMPORTXML. Opens in new tab is the next one. That's pretty hard. Just one more thing about the title is you can grab anything here any, you can grab the entire body of the page. You can grab what HTML import Discover how to import data from various sources into Google Sheets. Opens in new tab html does is grab these like tables.<br><br>But you can grab anything. You just know how to, you need to know how to format Find out how to format your data in Google Sheets for better presentation. Opens in new tab it, which the sort Learn how to sort data in Google Sheets to make analysis easier. Opens in new tab of bracket stuff like title is pretty simple. Okay. Next is an image Learn how to use images in Google Sheets with functions like IMAGE and IMPORTXML. Opens in new tab . So what I did is I went to the meta name meta tag. And here's OG image Learn how to use images in Google Sheets with functions like IMAGE and IMPORTXML. Opens in new tab .
There might be other images, so for social shares, and a page can have Facebook image Learn how to use images in Google Sheets with functions like IMAGE and IMPORTXML. Opens in new tab , Twitter image Learn how to use images in Google Sheets with functions like IMAGE and IMPORTXML. Opens in new tab .<br><br>They'll have different images here. But this one only has one has OG image Learn how to use images in Google Sheets with functions like IMAGE and IMPORTXML. Opens in new tab . And I just wanna note Discover how to add and manage notes in your Google Sheets. Opens in new tab what this says. So it's meta property equals og image Learn how to use images in Google Sheets with functions like IMAGE and IMPORTXML. Opens in new tab content equals this url. So the, if we would, if we did just prop meta, it would give us all of. Text outside of these brackets, but we actually want to get this text inside of the content and we don't want all of the metas, we just want the meta with the property of OG image Learn how to use images in Google Sheets with functions like IMAGE and IMPORTXML. Opens in new tab .<br><br>So here's how we do it. I will show you an example.
So this is the end result. It says meta, and then in brackets we put the AT property. Function Understand how to create and use functions in Google Sheets for better data manipulation. Opens in new tab , which is a class at means class, and we are looking for the class of property where Understand how to use the WHERE clause in queries for data filtering. Opens in new tab the, which is equal to OG image Learn how to use images in Google Sheets with functions like IMAGE and IMPORTXML. Opens in new tab . So the class is property that was over here in the orange or brown part.<br><br>That's the class. And we're looking for OG image Learn how to use images in Google Sheets with functions like IMAGE and IMPORTXML. Opens in new tab where Understand how to use the WHERE clause in queries for data filtering. Opens in new tab it equals OG image Learn how to use images in Google Sheets with functions like IMAGE and IMPORTXML. Opens in new tab , and that's the only one we're looking for. And then we close the bracket and then add at content, because we don't want the con, we don't, here, I'll actually show you what this looks like if we don't put the at content.
So we want the image Learn how to use images in Google Sheets with functions like IMAGE and IMPORTXML. Opens in new tab first.<br><br>We need to get the image Learn how to use images in Google Sheets with functions like IMAGE and IMPORTXML. Opens in new tab url and then we can put it into an image Learn how to use images in Google Sheets with functions like IMAGE and IMPORTXML. Opens in new tab . Function Understand how to create and use functions in Google Sheets for better data manipulation. Opens in new tab . So what if we don't get the content? This is what happens. Nothing because there's nothing in the. Brackets, right? So title gives us the title because that's outside of the brackets, but because there's nothing here, we need to say, Hey, oh, we don't actually want the meta property, OGM image Learn how to use images in Google Sheets with functions like IMAGE and IMPORTXML. Opens in new tab .<br><br>We don't want the text there. We want actually, what's the text inside of at content? So we do the class content and we get that.
Now we have, we can copy and paste that down here, and we have images for each one, but we don't have the image Learn how to use images in Google Sheets with functions like IMAGE and IMPORTXML. Opens in new tab in the, your in the. You are more than welcome to stop here and wrap Learn how to wrap text in cells for better readability in Google Sheets. Opens in new tab the URL of the image Learn how to use images in Google Sheets with functions like IMAGE and IMPORTXML. Opens in new tab .<br><br>But we could also go one step further and say image Learn how to use images in Google Sheets with functions like IMAGE and IMPORTXML. Opens in new tab and put that into bracket parenthesis. And now it goes and it actually uploads the image Learn how to use images in Google Sheets with functions like IMAGE and IMPORTXML. Opens in new tab to our Google sheet. So this is pretty cool to get some visual representation into our document.
You can use that as little thumbnail or something to look through it, but pretty cool way to get some.<br><br>Bring some images into a web page Google sheet. The meta description is a harder part because there is no meta description here. So what I did is, you can see like why there's no med, like literally there's just no meta description. They do. Wikipedia does something different here. They have these notes Explore how to use notes effectively in your Google Sheets. Opens in new tab or they have rolled note Discover how to add and manage notes in your Google Sheets. Opens in new tab .<br><br>Here I'll show you what I did. I grabbed yeah, meta diviv roll equals note Discover how to add and manage notes in your Google Sheets. Opens in new tab . So I went here. I found roll. Let's see. Yeah. Here. Roll equals note Discover how to add and manage notes in your Google Sheets. Opens in new tab .
And I was like, oh, this is, one of, these is probably, this article is about the rocket manufacturer. Okay, that's probably it. But there's many of them. So how do you parse through many of them?<br><br>This is the problems we use. Let me show you what the original looks like and then we'll use index Understand how to use the INDEX function to retrieve data from a specific location. Opens in new tab to figure out which one we want to use. So we do equals, and now here what I did is I want to get everything with the class Diviv, not class, something else.
Every diviv that has the class role, that equals note Discover how to add and manage notes in your Google Sheets. Opens in new tab .<br><br>And when I do that, you'll see, oh my God, it's a lot of stuff and it's a lot of stuff in a lot of different. Rows and columns. So each of these are in rows and columns as well. And how we reference Learn about cell references and how to use them in your formulas. Opens in new tab rows and columns is index Understand how to use the INDEX function to retrieve data from a specific location. Opens in new tab . Let's see. We want let's just grab this like main article one. And so what we're going to do is go index Understand how to use the INDEX function to retrieve data from a specific location. Opens in new tab and we want to at the end do comma, which road do we want?<br><br>We want the third row. We want the second column, and that tells us where Understand how to use the WHERE clause in queries for data filtering. Opens in new tab it is. If you look over here, tells US history of space.
Boom, we got it. But now when we copy and paste that down, we get some reference Learn about cell references and how to use them in your formulas. Opens in new tab errors. Why do we get that? It says that it's not within the function Understand how to create and use functions in Google Sheets for better data manipulation. Opens in new tab . So let's take off index Understand how to use the INDEX function to retrieve data from a specific location. Opens in new tab of this one and see what we get.<br><br>We only get one thing here. We only get two things. So each one is gonna have its own unique Discover how to find unique values in your data using Google Sheets functions. Opens in new tab we might want to do index Understand how to use the INDEX function to retrieve data from a specific location. Opens in new tab . This might not be the best way, but I'm just showing it to you. Get. Okay. We want index Understand how to use the INDEX function to retrieve data from a specific location. Opens in new tab one, one that's only gives us main article. Maybe we want index Understand how to use the INDEX function to retrieve data from a specific location. Opens in new tab one and column two. Great.
That is some kind of description.<br><br>Obviously it is much, much easier if you actually have a meta description in a webpage. Wikipedia doesn't. But you can try to figure out as well with this formula Get familiar with the syntax rules for writing formulas in Google Sheets. Opens in new tab here. And you're more than welcome to copy this and look up import Discover how to import data from various sources into Google Sheets. Opens in new tab XML stuff because I didn't do a great job in explaining exactly how this works, but I just know that.<br><br>Because, I don't know, I have to look it up almost every time that I use it. So it, this is looking up every diviv with the class of role that equals note Discover how to add and manage notes in your Google Sheets. Opens in new tab .
With the, I forgot what it was called, but when it's class, like the data Explore different types of data you can work with in Google Sheets. Opens in new tab , the I item note Discover how to add and manage notes in your Google Sheets. Opens in new tab . And then you're gonna get a big list. In this case, you didn't get a big list in the title cause we didn't even use any classes here.<br><br>We just did title image Learn how to use images in Google Sheets with functions like IMAGE and IMPORTXML. Opens in new tab . You may end up with multiple images, that's fine. Then you can use index Understand how to use the INDEX function to retrieve data from a specific location. Opens in new tab as well. But here we used image Learn how to use images in Google Sheets with functions like IMAGE and IMPORTXML. Opens in new tab . Hopefully that was helpful to you. And sufficed as an answer, if any of this. If you wanna go deeper, ask a follow up question.
If you are confused by anything, I'm more than happy to share Learn how to share your Google Sheets with others for collaboration. Opens in new tab some resources with you.<br><br>But do look into like import Discover how to import data from various sources into Google Sheets. Opens in new tab xml. Exactly how to use this because this is using XPath and you really need to just read the XPath documentation again. I have to read that XPath documentation almost every time I use it. Cause I don't use it. I don't use it super often. It's not like a daily thing.<br><br>I'm importing X ml information I used to, so it's like a little fuzzy after three years of not using it every day.
But the XPath documentation is spot on and helped me through all these problems and also just troubleshooting and. Trial and error Get insights on common errors in Google Sheets and how to fix them. Opens in new tab through this because sometimes you think you got it and then you put in brackets something that you're like, oh, I shouldn't have done the brackets.<br><br>There are some common pitfalls here with XML as well because you'll get multiple things. Use, you can use Index Understand how to use the INDEX function to retrieve data from a specific location. Opens in new tab to fix that. You can, I think you can even use filter Understand how to filter data in Google Sheets for focused analysis. Opens in new tab for that. But I usually use Index Understand how to use the INDEX function to retrieve data from a specific location. Opens in new tab to get exactly the one I want. And hopefully this is helpful to you.
And you're more than welcome to use this sheet.<br><br>I, I made sure.</div>
Topics