Home > database >  Locale setting of importxml function in google sheet not working
Locale setting of importxml function in google sheet not working

Time:01-24

I'm trying to extract prices from bookdepositary site in local currency. However, it always retrieves the USD prices no matter what I am trying.

A specific example is:

=IMPORTXML("https://www.bookdepository.com/1/9783836519885";"//span[@class='sale-price']";"bg-BG")

gives US$47.63 no matter that Google sheet settings are changed to Bulgarian and despite of the locale set to "bg-BG".

The same US$47.63 result is retrieved when I use another scrap method like: =IMPORTXML("https://www.bookdepository.com/1/9783836519885";"//meta[@itemprop='price']/@content";"bg-BG")

The following does not retrieve any result (but this is a secondary problem I am investigating which will follow once I understand the locale problem): =IMPORTXML("https://www.bookdepository.com/1/9783836519885";"/html/body/div[2]/div[6]/div[3]/div/div[1]/div[1]/div[3]/div/div[2]/div/div[3]/div/span[1]";"bg-BG")

What do you think - is there a workaround?

CodePudding user response:

I don't think that can be done with importXML().

The enter image description here

and then the formula will be from:

enter image description here

=IMPORTXML("https://de.4everproxy.com/direct/aHR0cHM6Ly93d3cuYm9va2RlcG9zaXRvcnkuY29tLzEvOTc4MzgzNjUxOTg4NQ--","//span[@class='sale-price']")

enter image description here

  • Related