1. Home
  2. Functions
  3. Web
  4. IMPORTXML

IMPORTXML function

Imports data from a web page using an XPath query. Live web data is not available yet, so this returns #BLOCKED!.

Syntax

=IMPORTXML(url, xpath_query, [locale])

Arguments

ArgumentRequiredDescription
urlRequiredThe page address
xpath_queryRequiredThe XPath query
localeOptionalLocale 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 #BLOCKED!

Every formula, right in your browser

SheetsBat calculates 536 functions, with charts, pivot tables and live collaboration. Free to start.