1
votes

I want to use ImportXML function in google sheets in order to bring some prices into my google sheet, how to find the correct Xpath for this ?

This is the URL: https://super.walmart.com.mx/verduras/aguacate-hass-extra-por-kilo/00000000003354

and im trying to bring the price, in this case is $39.90

I was trying this formula but im getting NA (imported content is empty)

=IMPORTXML("https://super.walmart.com.mx/verduras/aguacate-hass-extra-por-kilo/00000000003354","//*[@id="scrollToTopComponent"]/section/div[1]/div[2]/div[2]/div[3]/h4/text()[1]")

Thanks

1

1 Answers

0
votes

IMPORTXML does not work on Javascript content

You can verify that that the URL https://super.walmart.com.mx/verduras/aguacate-hass-extra-por-kilo/00000000003354 content loads via Javascript by

  • going on your Browser settings
  • Disable / block Javascript

enter image description here


  • Refresh your URL
  • See the following:

enter image description here


So, unfortunately you cannot use IMPORTXML to get the content of this URL.