Syntax
=IMPORTXML(url, xpath_query, [locale])Arguments
| Argument | Required | Description |
|---|---|---|
url | Required | The page address |
xpath_query | Required | The XPath query |
locale | Optional | Locale for parsing |
How to use IMPORTXML
This function reads data from outside the workbook, so its result depends on what the source returns when the sheet calculates.
IMPORTXML takes 2 required arguments and 1 optional argument. Type =IMPORTXML( in a cell and SheetsBat shows the arguments as you go. Optional arguments are shown in square brackets; leave them out to use their default.
Examples
Each result below was calculated by the SheetsBat formula engine.
=IMPORTXML("https://example.com", "//a")Result Related web functions
- GOOGLEFINANCEGets current or past stock market data. Live web data is not available yet, so this returns #BLOCKED!.
- HYPERLINKCreates a link that opens a web page or a place in the workbook when clicked.
- IMAGEShows a picture from a web address inside the cell.
- IMPORTDATAImports a CSV or TSV file from a web address. Live web data is not available yet, so this returns #BLOCKED!.
- IMPORTFEEDImports an RSS or Atom feed. Live web data is not available yet, so this returns #BLOCKED!.
- IMPORTHTMLImports a table or list from a web page. Live web data is not available yet, so this returns #BLOCKED!.
- IMPORTRANGEImports a range from another spreadsheet. Live web data is not available yet, so this returns #BLOCKED!.
- STOCKHISTORYGets the price history of a stock. Live web data is not available yet, so this returns #BLOCKED!.
- WEBSERVICEReads data from a web service. Web access is turned off for safety, so this returns #BLOCKED!.