IMPORTXML

Imports data from any of various structured data types including XML, HTML, CSV, TSV and RSS and Atom XML feeds.

Sample usage

IMPORTXML("https://en.wikipedia.org/wiki/Moon_landing", "//a/@href")

IMPORTXML(A2,B2)

Syntax

IMPORTXML(url, xpath_query, locale)

  • url – The URL of the page to be examined, including protocol (e.g. http://).

    • The value for url must either be enclosed in quotation marks or be a reference to a cell containing the appropriate text.
  • xpath_query – The XPath query to be run on the structured data.

  • locale – A language and region locale code to use when parsing the data. If unspecified, the document locale is used.

See also

IMPORTRANGE: Imports a range of cells from a specified spreadsheet.

IMPORTHTML: Imports data from a table or list within an HTML page.

IMPORTFEED: Imports an RSS or Atom feed.

IMPORTDATA: Imports data from a given URL in .csv (comma-separated value) or .tsv (tab-separated value) format.

Learn how to optimise your data reference.

true
Visit the Learning Center

Using Google products, like Google Docs, at work or school? Try powerful tips, tutorials, and templates. Learn to work on Office files without installing Office, create dynamic project plans and team calendars, auto-organize your inbox, and more.

Search
Clear search
Close search
Main menu
16543223662165839341
true
Search Help Centre
true
true
true
true
true
35
false
false