Challenge - 5 Problems
IMPORTXML Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
📊 Formula Result
intermediate2:00remaining
Extracting all headlines from a news website
You want to extract all the main headlines from a news website using IMPORTXML. The headlines are inside <h2> tags with class 'headline'. Which formula will correctly extract these headlines?
Attempts:
2 left
💡 Hint
Remember that IMPORTXML uses XPath syntax to select elements by tag and attribute.
✗ Incorrect
The correct XPath to select all <h2> tags with class 'headline' is //h2[@class='headline']. Option B uses this correctly. Other options select wrong tags or non-existent tags.
📊 Formula Result
intermediate2:00remaining
Extracting all links from a webpage
You want to get all URLs from the links (<a> tags) on a webpage using IMPORTXML. Which formula will return the href attribute of all <a> tags?
Attempts:
2 left
💡 Hint
To get attribute values in XPath, use @attribute_name.
✗ Incorrect
Option C correctly uses //a/@href to select the href attribute of all <a> tags. Other options use invalid XPath syntax or select wrong nodes.
❓ Function Choice
advanced2:00remaining
Choosing the right XPath to extract product prices
A webpage shows product prices inside <span> tags with class 'price'. Which XPath expression will correctly extract all prices using IMPORTXML?
Attempts:
2 left
💡 Hint
XPath attribute values must be in quotes and attribute name is case-sensitive.
✗ Incorrect
Option A uses correct XPath syntax with attribute selector and quotes. Option A misses @, C misses quotes, D uses wrong case for class value.
🎯 Scenario
advanced2:00remaining
Handling dynamic content with IMPORTXML
You try to use IMPORTXML to get data from a webpage, but the formula returns #N/A with 'Imported content is empty'. The webpage content is loaded dynamically by JavaScript after page load. What is the best explanation?
Attempts:
2 left
💡 Hint
Think about how IMPORTXML fetches webpage data and what it can see.
✗ Incorrect
IMPORTXML fetches the static HTML source only. It cannot see content loaded later by JavaScript, so it returns empty results if data is dynamic.
❓ data_analysis
expert2:00remaining
Counting the number of items extracted by IMPORTXML
You use the formula =IMPORTXML("https://example.com/products", "//div[@class='item-name']") to get product names. The result fills cells A1:A10. What is the formula to count how many product names were extracted?
Attempts:
2 left
💡 Hint
Think about which function counts non-empty cells regardless of data type.
✗ Incorrect
COUNTA counts all non-empty cells including text. COUNT counts only numbers, so it would miss text product names. COUNTIF with "*" also counts non-empty text but COUNTA is simpler. ROWS counts total rows regardless of content.