Recall & Review
beginner
What does the IMPORTXML function do in Google Sheets?
IMPORTXML fetches data from a web page by extracting structured data using XPath queries. It helps you pull specific parts of a webpage like tables, lists, or links directly into your sheet.
Click to reveal answer
beginner
What are the two main arguments of IMPORTXML?
The first argument is the URL of the webpage you want to get data from. The second argument is the XPath query that tells Google Sheets which part of the page to extract.
Click to reveal answer
intermediate
Example XPath query to get all links (<a> tags) from a webpage?
Use the XPath query
//a/@href. This selects the href attribute of all anchor tags, which are the links on the page.Click to reveal answer
intermediate
Why might IMPORTXML return an error or no data?
Common reasons include: the URL is incorrect or blocked, the XPath query is wrong or too specific, or the webpage uses JavaScript to load data dynamically which IMPORTXML can't read.
Click to reveal answer
intermediate
How can you find the correct XPath for data you want to import?
Use your browser's Developer Tools to inspect the webpage elements. Right-click the element, choose 'Inspect', then right-click the highlighted code and select 'Copy XPath' or write a simple XPath based on the HTML structure.
Click to reveal answer
What is the correct syntax to import all paragraph texts from a webpage using IMPORTXML?
✗ Incorrect
The XPath //p selects all paragraph elements, so IMPORTXML("url", "//p") imports all paragraphs.
Which of these is NOT a valid reason for IMPORTXML to fail?
✗ Incorrect
IMPORTXML failure is usually due to URL, XPath, or dynamic content issues, not the number of rows in the sheet.
What does the XPath query //a/@href select?
✗ Incorrect
The query //a/@href selects the href attribute values of all anchor () tags, which are the links.
How do you specify the webpage URL in IMPORTXML?
✗ Incorrect
The first argument of IMPORTXML is the URL string of the webpage.
Which tool helps you find XPath queries easily?
✗ Incorrect
Browser Developer Tools let you inspect webpage elements and copy XPath queries.
Explain how to use IMPORTXML to get a list of all links from a webpage into Google Sheets.
Think about what part of the webpage holds links and how to write XPath for it.
You got /4 concepts.
Describe common reasons why IMPORTXML might not return data and how to troubleshoot them.
Consider what IMPORTXML can and cannot read from webpages.
You got /5 concepts.