0
votes

I am trying to create a price scrape sheet in google sheets using the IMPORTXMLfunction. I'm having trouble identifying the path for which the price on the product page.

I've tried copying the xPath using the inspect element in Chrome but it's copying the following: //*[@id="ajaxPrice"]/span[2]

I'm sure this is not the path.

Can someone please help?

Product page: https://homedepot.com/p/206651614

2

2 Answers

0
votes

How about this xpath?

=IMPORTXML(A1, "//span[@id='ajaxPrice']/@content")
  • Cell "A1" has the URL of https://homedepot.com/p/206651614.

enter image description here

If this was not the result you want, I apologize. At that time, can you tell me about the value you want? I would like to modify it.

0
votes

you can do it like this too:

=REGEXEXTRACT(QUERY(ARRAY_CONSTRAIN(
 IMPORTDATA("https://homedepot.com/p/206651614"), 1500, 1), 
 "where Col1 contains 'ciItemPrice'"), "\d+.\d+|\d+")

0