{"id":2660,"date":"2021-04-01T16:05:00","date_gmt":"2021-04-01T14:05:00","guid":{"rendered":"https:\/\/importsheet.com\/?p=2660"},"modified":"2026-10-29T14:45:38","modified_gmt":"2026-10-29T13:45:38","slug":"formula-importxml-no-google-sheets","status":"publish","type":"post","link":"https:\/\/www.sheetgo.com\/pt\/blog\/google-sheets-formulas\/importxml-formula-google-sheets\/","title":{"rendered":"Como usar a f\u00f3rmula IMPORTXML no Planilhas Google"},"content":{"rendered":"<p>[et_pb_section fb_built=&#8221;1&#8243; admin_label=&#8221;section&#8221; module_class=&#8221;sheetgo-post&#8221; _builder_version=&#8221;4.16&#8243; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221; da_is_popup=&#8221;off&#8221; da_exit_intent=&#8221;off&#8221; da_has_close=&#8221;on&#8221; da_alt_close=&#8221;off&#8221; da_dark_close=&#8221;off&#8221; da_not_modal=&#8221;on&#8221; da_is_singular=&#8221;off&#8221; da_with_loader=&#8221;off&#8221; da_has_shadow=&#8221;on&#8221; da_disable_devices=&#8221;off|off|off&#8221;][et_pb_row admin_label=&#8221;row&#8221; _builder_version=&#8221;4.16&#8243; background_size=&#8221;initial&#8221; background_position=&#8221;top_left&#8221; background_repeat=&#8221;repeat&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;][et_pb_column type=&#8221;4_4&#8243; _builder_version=&#8221;4.16&#8243; custom_padding=&#8221;|||&#8221; global_colors_info=&#8221;{}&#8221; custom_padding__hover=&#8221;|||&#8221; theme_builder_area=&#8221;post_content&#8221;][et_pb_text _builder_version=&#8221;4.24.1&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<p><b>The <\/b><a href=\"https:\/\/support.google.com\/docs\/answer\/3093342\" target=\"_blank\" rel=\"noopener\"><b>IMPORTXML<\/b><\/a><b> Google Sheets function lets you import data<\/b> from structured data types like HTML and XML. It also supports data import from CSV, TSV, RSS and ATOM XML feeds. This makes it a great tool to import data from websites for web scraping or data mining.<\/p>\n<p>[\/et_pb_text][et_pb_text _builder_version=&#8221;4.22.2&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<p>IMPORTXML reads a page that is live on the web, through its URL. It isn&#8217;t the way to load an .xml file saved on your computer.<\/p>\n<p>[\/et_pb_text][et_pb_text _builder_version=&#8221;4.24.1&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<h2>Syntax<\/h2>\n<p>[\/et_pb_text][et_pb_text module_class=&#8221;spreadsheet-function&#8221; _builder_version=&#8221;4.24.1&#8243; border_width_left=&#8221;4px&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<p>=IMPORTXML(url, xpath_query, locale)<\/p>\n<p>[\/et_pb_text][et_pb_text _builder_version=&#8221;4.24.1&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<ul>\n<li><b>url<\/b> \u2013 the address of the structured web page from which you want to import data. There are two ways to include this:\n<ul>\n<li>As a fully qualified location in the form of text between quotations (for example, \u201chttps:\/\/en.wikipedia.org\/wiki\/Tiger_Woods\u201d)<\/li>\n<li>As a reference to a cell that holds the url.<\/li>\n<\/ul>\n<\/li>\n<li><b>xpath_query<\/b> \u2013 this is the XPath query to run on the structured data. Simply put, this specifies the information we are trying to fetch. For instance, using \u201c\/\/h1\/@id\u201d gives all the id attributes within the anchor &lt;h1&gt; tags on the page. <a href=\"https:\/\/www.w3schools.com\/xml\/xpath_syntax.asp\" target=\"_blank\" rel=\"noopener\">Check out XPath syntax guidelines<\/a> for detailed instructions.<\/li>\n<\/ul>\n<p>If this is new to you, you may be a bit confused when looking at the <b>xpath_query<\/b> parameter. But it is just as powerful as it is confusing, so we encourage you to look into it.<\/p>\n<p>[\/et_pb_text][et_pb_text admin_label=&#8221;Connections T &#8211; Automate between spreadsheets &#8211; Horizontal&#8221; module_class=&#8221;sheetgo-post-no-shadow-img md2-contained-button-light vertical-banner-container&#8221; _builder_version=&#8221;4.27.4&#8243; _module_preset=&#8221;default&#8221; background_color=&#8221;#f2f7ff&#8221; max_width=&#8221;700px&#8221; module_alignment=&#8221;center&#8221; max_height=&#8221;300px&#8221; custom_margin=&#8221;20px|0px|20px|0px|true|true&#8221; custom_padding=&#8221;25px|25px|25px|25px|true|true&#8221; sticky_limit_bottom=&#8221;section&#8221; border_radii=&#8221;on|20px|20px|20px|20px&#8221; border_width_all=&#8221;1px&#8221; border_color_all=&#8221;#d9e7ff&#8221; saved_tabs=&#8221;all&#8221; global_colors_info=&#8221;{}&#8221; global_module=&#8221;255443&#8243; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/static.sheetgo.com\/wp-content\/uploads\/2024\/09\/run-automatically-connect-sheet-icons.webp\" width=\"250\" height=\"168\" alt=\"\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/static.sheetgo.com\/wp-content\/uploads\/2024\/09\/Recommended-for-Google-Workspace-badge.webp\" width=\"150\" height=\"180\" alt=\"39\" \/><\/p>\n<p><span style=\"font-size: 22px; font-weight: 600;\">Automate data transfers between spreadsheets<br \/><\/span><\/p>\n<p><a href=\"https:\/\/www.sheetgo.com\/automations\/\" target=\"_blank\" rel=\"noopener\">Find out how<\/a><\/p>\n<p>[\/et_pb_text][et_pb_text _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<h3>IMPORTXML example<\/h3>\n<p>[\/et_pb_text][et_pb_text module_class=&#8221;spreadsheet-function&#8221; _builder_version=&#8221;4.24.1&#8243; border_width_left=&#8221;4px&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<p>=IMPORTXML(url, &#8220;all the hyperlink titles in the page&#8221;)<\/p>\n<p>[\/et_pb_text][et_pb_text _builder_version=&#8221;4.24.1&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<p>In the example below, I import the data into cell B3, so that\u2019s the destination to include in the formula.<\/p>\n<p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/static.sheetgo.com\/wp-content\/uploads\/2021\/10\/IMPORTXML-1.png&#8221; alt=&#8221;IMPORTXML Google Sheets \u2014 formula in B3 pulling \/\/a\/@title from the Tiger Woods Wikipedia page, with the syntax help box open&#8221; title_text=&#8221;Formula in B3 pulling \/\/a\/@title from the Tiger Woods Wikipedia page, with the syntax help box open&#8221; _builder_version=&#8221;4.24.1&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;][\/et_pb_image][et_pb_text _builder_version=&#8221;4.24.1&#8243; _module_preset=&#8221;default&#8221; custom_padding=&#8221;||0px|||&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<p>The formula I used included the url in quotations as previously mentioned. It uses the Xpath query \u201c\/\/a\/@title\u201d to <strong>fetch all the hyperlink titles within the article<\/strong>.\u00a0<\/p>\n<p>Give the formula a try! You will be warned that the spreadsheet is trying to send and receive data, just allow it to get all the information.<\/p>\n<p>[\/et_pb_text][et_pb_text module_class=&#8221;spreadsheet-function&#8221; _builder_version=&#8221;4.24.1&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<p><b>=IMPORTXML(<\/b><b>&#8220;<\/b><b>https:\/\/en.wikipedia.org\/wiki\/Tiger_Woods<\/b><b>&#8220;<\/b><b>, <\/b><b>&#8220;\/\/a\/@title&#8221;<\/b><b>)<\/b><\/p>\n<p>[\/et_pb_text][et_pb_text _builder_version=&#8221;4.24.1&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<p>Below is what you\u2019ll see as Google Sheets tries to fetch the data. The higher the number of nodes in the structured data file, the longer it will take to import the data.<\/p>\n<p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/static.sheetgo.com\/wp-content\/uploads\/2021\/04\/2.-IMPORTXML-loading-data-500&#215;300-1.png&#8221; alt=&#8221;IMPORTXML Google Sheets \u2014 cell B3 showing Loading&#8230; while the data imports&#8221; title_text=&#8221;Cell B3 showing Loading&#8230; while the data imports&#8221; align=&#8221;center&#8221; _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;][\/et_pb_image][et_pb_text _builder_version=&#8221;4.24.1&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<p>While the data import is in progress, the cell in which you typed the formula looks like it generated an error.<\/p>\n<p>However, it isn\u2019t an error, but just a temporary state. This means that the data is loading. Hover your mouse over the cell to see the following description.<\/p>\n<p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/static.sheetgo.com\/wp-content\/uploads\/2021\/04\/3.-IMPORTXML-loading-data-error-500&#215;300-1.png&#8221; alt=&#8221;IMPORTXML Google Sheets \u2014 Loading data&#8230; message in the error box while the import runs&#8221; title_text=&#8221;Loading data&#8230; message in the error box while the import runs&#8221; align=&#8221;center&#8221; _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;][\/et_pb_image][et_pb_text _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<p>As soon as Google Sheets loads the data, the error disappears. You\u2019ll notice the data extends from the formula cell (B3) to the right and further down.<\/p>\n<p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/static.sheetgo.com\/wp-content\/uploads\/2021\/10\/IMPORTXML-4.png&#8221; alt=&#8221;IMPORTXML Google Sheets \u2014 hyperlink titles from the Wikipedia page filling column B from B3 down&#8221; title_text=&#8221;Hyperlink titles from the Wikipedia page filling column B from B3 down&#8221; _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;][\/et_pb_image][et_pb_text _builder_version=&#8221;4.24.1&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<p><strong>This is an auto expanding function<\/strong>, meaning all the values fetched will be included in the cells below it.<\/p>\n<p>It\u2019s important that you <strong>keep the expected area of the result clear<\/strong> of any values. Otherwise, IMPORTXML formula will result in a #REF! error.<\/p>\n<p>For example, the following image demonstrates what happens if you have any values within that range.<\/p>\n<p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/static.sheetgo.com\/wp-content\/uploads\/2021\/10\/IMPORTXML-5.png&#8221; alt=&#8221;IMPORTXML Google Sheets \u2014 #REF! error because the result would overwrite data in B9&#8243; title_text=&#8221;#REF! error because the result would overwrite data in B9&#8243; _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;][\/et_pb_image][et_pb_text module_class=&#8221;spreadsheet-function&#8221; _builder_version=&#8221;4.16&#8243; border_width_left=&#8221;4px&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]=IMPORTXML(url cell reference, \u201call the h2 headers in the page\u201d)[\/et_pb_text][et_pb_text _builder_version=&#8221;4.24.1&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<p>In this example, in the cell B1, I have stored the <b>url<\/b> to the page from which I am trying to import the header information.<\/p>\n<p>I\u2019ll use that cell as a reference in the IMPORTXML formula:\u00a0<\/p>\n<p>[\/et_pb_text][et_pb_text module_class=&#8221;spreadsheet-function&#8221; _builder_version=&#8221;4.24.1&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<p><b>=IMPORTXML(B1,&#8221;\/\/h2&#8243;)<\/b><\/p>\n<p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/static.sheetgo.com\/wp-content\/uploads\/2021\/10\/IMPORTXML-6.png&#8221; alt=&#8221;IMPORTXML Google Sheets \u2014 formula with the URL in B1 and \/\/h2 listing the page&#8217;s H2 headings in column B&#8221; title_text=&#8221;Formula with the URL in B1 and \/\/h2 listing the page&#8217;s H2 headings in column B&#8221; _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;][\/et_pb_image][et_pb_text _builder_version=&#8221;4.24.1&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<p>As you can see, the data being pulled here is different from the previous example, even though the URL is the same.<\/p>\n<p>This time, I have a list of the headers in the article. This could be useful for a variety of reasons. If there\u2019s other information that you want to import from the URL, I encourage you to read more about <a href=\"https:\/\/www.w3schools.com\/xml\/xpath_syntax.asp\" target=\"_blank\" rel=\"noopener\">XPath queries<\/a>.<\/p>\n<p>[\/et_pb_text][et_pb_text _builder_version=&#8221;4.22.2&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<h2>More XPath examples for IMPORTXML<\/h2>\n<p>The xpath_query decides what IMPORTXML pulls from the page. These queries cover the most common jobs. Replace the URL with the page you want to read, or point to a cell that holds it.<\/p>\n<h3>Scrape every link on a page<\/h3>\n<p><code>=IMPORTXML(\"https:\/\/en.wikipedia.org\/wiki\/Tiger_Woods\", \"\/\/a\/@href\")<\/code><\/p>\n<p>This returns the address of every link on the page, one per row. Links to other pages on the same site usually come back as relative paths, such as \/wiki\/PGA_Tour. If you use &#8220;\/\/@href&#8221; instead, you also get the href of other tags, such as stylesheets and icons.<\/p>\n<h3>Scrape only external links<\/h3>\n<p><code>=IMPORTXML(\"https:\/\/www.example.com\/\", \"\/\/a[starts-with(@href, 'http') and not(contains(@href, 'example.com'))]\/@href\")<\/code><\/p>\n<p>The query keeps links that start with http, which leaves out relative paths, and then removes any link that points back to the same domain. Replace example.com with the domain of the page you&#8217;re reading.<\/p>\n<h3>Get the canonical URL of a page<\/h3>\n<p><code>=IMPORTXML(\"https:\/\/www.example.com\/page\/\", \"\/\/link[@rel='canonical']\/@href\")<\/code><\/p>\n<p>The canonical link is the version of a page that its owner marks as the preferred one, to avoid duplicate content. This query returns that single URL.<\/p>\n<h3>Other useful queries<\/h3>\n<ul>\n<li><code>\/\/title<\/code> returns the page title.<\/li>\n<li><code>\/\/meta[@name='description']\/@content<\/code> returns the meta description.<\/li>\n<li><code>\/\/*[@id='main']<\/code> returns the element whose id is main.<\/li>\n<li><code>\/\/div[contains(@class, 'price')]<\/code> returns every div with price among its classes.<\/li>\n<\/ul>\n<p>For data that sits in a table or a list, the <a href=\"https:\/\/www.sheetgo.com\/blog\/google-sheets-formulas\/importhtml-formula-google-sheets\/\">IMPORTHTML formula<\/a> is usually simpler.<\/p>\n<p>[\/et_pb_text][et_pb_text _builder_version=&#8221;4.24.1&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<h2>Importxml could not fetch url<\/h2>\n<p>Naturally, this error message in Google Sheets usually means that there was a problem fetching the data.<\/p>\n<p>This error can occur due to various reasons, such as:<\/p>\n<ol>\n<li><b>Invalid URL<\/b>: Double-check that the URL provided in the IMPORTXML function is correct, including http or https. The page may also have moved to another address.<\/li>\n<li><b>Network issues<\/b>: Sometimes, this error may be the result of temporary network issues. Just wait a bit and try again.<\/li>\n<li><b>Access restrictions<\/b>: The website you&#8217;re trying to access may have restrictions in place. If this is the case, there is not much to do unless you can request access.<\/li>\n<li><b>Page structure changes<\/b>: If the function worked before but structure of the page changes, the XPath query may no longer work correctly. Update the XPath query to match the new structure of the webpage.<\/li>\n<li><b>Imported content is empty<\/b>: the formula reached the page but found nothing that matches the query. Check the XPath query, then open the page source in your browser to confirm the data is in the HTML. Pages that load their content with JavaScript show it in the browser, but IMPORTXML only sees the HTML the server sends.<\/li>\n<li><b>The site blocks Google Sheets<\/b>: some sites, including several finance data sites, refuse requests from Google&#8217;s fetcher. The page opens in your browser, but the formula still can&#8217;t fetch it. No change to the formula fixes this, so use another source or the site&#8217;s own API.<\/li>\n<li><b>Too many formulas<\/b>: each IMPORTXML formula sends its own request, and Google Sheets refreshes them about every hour. A file with hundreds of them loads slowly and can hit a site&#8217;s limits. A few formulas that each return a whole list work better.<\/li>\n<\/ol>\n<p>[\/et_pb_text][et_pb_text _builder_version=&#8221;4.24.1&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<h2>A wrap-up on IMPORTXML<\/h2>\n<p>You can also check out the following blog post to learn how to pull data into Google Sheets from a table or a list on an HTML page with the <a href=\"https:\/\/www.sheetgo.com\/blog\/google-sheets-formulas\/importhtml-formula-google-sheets\/\">IMPORTHTML Google Sheets function <\/a>or <a href=\"https:\/\/www.sheetgo.com\/blog\/google-sheets-formulas\/importfeed-formula-google-sheets\/\">How to use the IMPORTFEED formula.<\/a> To pull a CSV or TSV file from a URL, use the <a href=\"https:\/\/www.sheetgo.com\/blog\/google-sheets-formulas\/importdata-formula-google-sheets\/\">IMPORTDATA formula<\/a>, and to bring in data from another spreadsheet, use <a href=\"https:\/\/www.sheetgo.com\/blog\/google-sheets-formulas\/importrange\/\">IMPORTRANGE<\/a>.<\/p>\n<p>[\/et_pb_text][et_pb_text _builder_version=&#8221;4.22.2&#8243; background_color=&#8221;#f9f9ff&#8221; custom_margin=&#8221;40px||40px||false|false&#8221; custom_padding=&#8221;15px|25px|15px|25px|true|true&#8221; border_width_left=&#8221;3px&#8221; border_color_left=&#8221;#808e95&#8243; saved_tabs=&#8221;all&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<p><em><strong>Editor\u2019s note<\/strong>: This is a revised version of a previous post that has been updated for accuracy and comprehensiveness.<\/em><\/p>\n<p>[\/et_pb_text][\/et_pb_column][\/et_pb_row][\/et_pb_section]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The IMPORTXML Google Sheets function lets you import data from structured data types like HTML and XML. It also supports data import from CSV, TSV, RSS and ATOM XML feeds. This makes it a great tool to import data from websites for web scraping or data mining.IMPORTXML reads a page that is live on the [&hellip;]<\/p>\n","protected":false},"author":40,"featured_media":33478,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_et_pb_use_builder":"on","_et_pb_old_content":"The <a href=\"https:\/\/support.google.com\/docs\/answer\/3093342\">IMPORTXML<\/a> formula in Google Sheets lets us import data from the structured data types like HTML and XML. It also supports data import from CSV, TSV, and RSS and ATOM XML feeds.\n<h3>Syntax<\/h3>\n<span style=\"font-size: 14pt;\"><strong><span style=\"font-family: courier new,courier,monospace;\">IMPORTXML(url, xpath_query)<\/span><\/strong><\/span>\n<ul>\n \t<li><span style=\"font-size: 12pt; font-family: courier new,courier,monospace;\"><strong>url<\/strong><\/span> - this is the address (uniform resource locator) to the structured page on the web, from which we are trying to import data from.\u00a0This can take two forms.\n<ul>\n \t<li>A valid and fully qualified location in the form of text (enclosed in double quotes). For example: <strong>\u201chttps:\/\/en.wikipedia.org\/wiki\/Tiger_Woods\u201d<\/strong><\/li>\n \t<li>Or it can be a reference to a cell (like <strong>B1<\/strong>) within Google Sheets, where the url is stored.<\/li>\n<\/ul>\n<\/li>\n \t<li><span style=\"font-family: courier new,courier,monospace; font-size: 12pt;\"><strong>xpath_query<\/strong><\/span> - this is the XPath query to run on the structured data. Simply put, this specifies what kind of information we are trying to fetch. For instance, using <strong><span style=\"font-family: courier new,courier,monospace; font-size: 12pt;\">\"\/\/h1\/@id\"<\/span><\/strong> as <span style=\"font-family: courier new,courier,monospace; font-size: 12pt;\"><strong>xpath_query<\/strong><\/span>, gives us to all the id attributes within the anchor <h1> tags available on the page. For XPath syntax guidelines, check out this <a href=\"https:\/\/www.w3schools.com\/xml\/xpath_syntax.asp\">link<\/a>.<\/li>\n<\/ul>\n<h3>Usage: IMPORTXML Formula<\/h3>\n<h5>Case # 1: IMPORTXML(url,\"all the hyper link titles in the page\")<\/h5>\nIn the\u00a0snapshot below, we are trying to import the data into the cell B3, which therefore becomes the destination to key in the IMPORTXML formula.\n\n<img class=\"aligncenter size-full wp-image-2669\" src=\"https:\/\/static.sheetgo.com\/wp-content\/uploads\/2017\/11\/importxml1.png\" alt=\"IMPORTXML Formula - Illustration 1\" width=\"656\" height=\"351\" \/>\n\nWe ensure the <span style=\"font-family: courier new,courier,monospace; font-size: 12pt;\"><strong>url<\/strong><\/span>\u00a0is valid, i.e. enclose <span style=\"font-family: courier new,courier,monospace; font-size: 12pt;\"><strong>url<\/strong><\/span> within double quotes and\u00a0hit the Enter key. Below\u00a0is what we see as Google Sheets tries to fetch the data. Higher the number of nodes in the structured data file, the longer it might take to finish the data import.\n\n<img class=\"aligncenter size-full wp-image-2670\" src=\"https:\/\/static.sheetgo.com\/wp-content\/uploads\/2017\/11\/importxml2.png\" alt=\"IMPORTXML Formula - Illustration 2\" width=\"453\" height=\"133\" \/>\n\nWhile the data import is in progress, the cell in which we keyed in the formula, looks like it\u00a0returned an error. Please note a little red speck on the top right corner of the cell. But, it isn\u2019t an error, just a transient state. Hover the mouse on the cell, to see the following description.\n\n<img class=\"aligncenter size-full wp-image-2671\" src=\"https:\/\/static.sheetgo.com\/wp-content\/uploads\/2017\/11\/importxml3.png\" alt=\"IMPORTXML Formula - Illustration 3\" width=\"553\" height=\"183\" \/>\n\nAs soon as Google Sheets loads the data, the red speck disappears. You\u2019ll notice the data extends from the formula cell (B3) to right and also further down.\n\n<img class=\"aligncenter size-full wp-image-2672\" src=\"https:\/\/static.sheetgo.com\/wp-content\/uploads\/2017\/11\/importxml4.png\" alt=\"IMPORTXML Formula - Illustration 4\" width=\"654\" height=\"563\" \/>\n\nSo, it is of utmost importance that we keep the expected real estate of the result,\u00a0clear of any preoccupied values. Otherwise, IMPORTXML formula might cough up a #REF! error. For example, following image explains what could happen, if we had any values, for instance, in cell B9.\n\n<img class=\"aligncenter size-full wp-image-2673\" src=\"https:\/\/static.sheetgo.com\/wp-content\/uploads\/2017\/11\/importxml5.png\" alt=\"IMPORTXML Formula - Illustration 5\" width=\"552\" height=\"242\" \/>\n<h5>Case # 2: IMPORTXML(url cell reference,\"all the h2 headers in the page\")<\/h5>\nHere, in the cell B1, we have stored the <strong>url<\/strong> to the page from which we are trying to import the header information. So, we\u2019ll use that cell to refer in the IMPORTXML formula.\n\n<img class=\"aligncenter size-full wp-image-2674\" src=\"https:\/\/static.sheetgo.com\/wp-content\/uploads\/2017\/11\/importxml6.png\" alt=\"IMPORTXML Formula - Illustration 6\" width=\"453\" height=\"410\" \/>\n\n\u00a0","_et_gb_content_width":"","footnotes":""},"categories":[54],"tags":[39,28],"class_list":["post-2660","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-google-sheets-formulas","tag-connections-t","tag-spreadsheets"],"acf":[],"permalink_manager":null,"_links":{"self":[{"href":"https:\/\/www.sheetgo.com\/pt\/wp-json\/wp\/v2\/posts\/2660","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.sheetgo.com\/pt\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sheetgo.com\/pt\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sheetgo.com\/pt\/wp-json\/wp\/v2\/users\/40"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sheetgo.com\/pt\/wp-json\/wp\/v2\/comments?post=2660"}],"version-history":[{"count":0,"href":"https:\/\/www.sheetgo.com\/pt\/wp-json\/wp\/v2\/posts\/2660\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.sheetgo.com\/pt\/wp-json\/wp\/v2\/media\/33478"}],"wp:attachment":[{"href":"https:\/\/www.sheetgo.com\/pt\/wp-json\/wp\/v2\/media?parent=2660"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sheetgo.com\/pt\/wp-json\/wp\/v2\/categories?post=2660"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sheetgo.com\/pt\/wp-json\/wp\/v2\/tags?post=2660"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}