XML : IMPORTXML not selecting first element

I've spent the past couple of days trying to figure out how to only get the first element using the following XMLIMPORT.

This is the URL of the website I'm trying to scrape: https://www.grainger.com/product/DURACELL-Battery-5LE23

I'm trying to get the price $25.45 without getting all the other prices ($17.36 $6.97, $32.80, $7.29, $19.09, $24.34, $149.05).

I've been using: =IMPORTXML("https://www.grainger.com/product/DURACELL-Battery-5LE23", "//span[@itemprop='price']/text()[1]") and it keeps showing me all 8 prices.

What am I doing wrong?

No comments:

Post a Comment