How to extract current price in Google Sheets using importxml from - google-sheets

I can't extract the price on this page with the importxml function: https://www.castorama.pl/regal-metalowy-gammel-180-x-90-x-40-cm-5-polek-175-kg-ocynk-id-69652.html
I tried to do it like below but it doesn't work.
=importxml(A1;"/html/body/div/div[2]/div/section/div[2]/div[2]/section/div[1]/section/span[2]/text()")

there is no price when you disable JS so your formula does not work because google sheets importxml cant read JS elements:

Related

IMPORTXML on google sheets error- Imported content is empty

I want to get the price from mercari, a japanese online shop.
For example, in this link, I like to get 1,488.
https://jp.mercari.com/item/m78226870756
when I copy the xpath of
<span class="number">
I get
//*[#id="item-info"]/section[1]/section[1]/div[1]/mer-price//span[2]
Now, using google sheet importxml
=IMPORTXML("https://jp.mercari.com/item/m78226870756","//*[#id='item-info']/section[1]/section[1]/div[1]/mer-price//span[2]")
I receive a
#N/A Imported content is empty.
I would really like to know how to get the price.
I am not familiar with this at all.
Any other way other than google sheet is also welcome.
you are getting #N/A error due to importxml (or any other import) formula does not support the scrapping of JavaScript elements. you can test this always by disabling JS for a given site and what's left can be usually imported into google sheets

how can I get a list of spreadsheet names from list with spreadsheet links?

In a spreadsheet, I have a column with URLs to other google spreadsheets. I would like to retrieve the names/titles of the corresponding spreadsheets in the second column. Thanks for helping me out.
I think you can do it with XPath and IMPORTXML. Try this:
=IMPORTXML(A2;"//meta[#itemprop='name']/#content")
Where A2 is the link to spreadsheet.

Convert XLTM to Google Spreadsheet formula parse error

I have a very old excel template which works fine on all latest office versions. Now I am trying to convert this excel template to Google Spreadsheet. I have completed almost 90% of the conversion except some formulas which are shoing parse error in Google Spreadsheet.
Excel Template is using a formula like =IF(B182="","",VLOOKUP(B182,[1]!PRICE_AREA,2,FALSE)). In this formula, I am not able to understand the range given in VLOOKUP formula.
Could someone help me to interpret this range notation which is [1]!PRICE_AREA
Thanks in advance
I realized that the template has references to some other excel spreadsheet. When try to convert using Google Converter, it automatically stripped the path to the other excel file and put [1] text. Now I am using IMPORTRANGE formula in Google Spreadsheet to import the range value from other spreadsheet and it works fine.

Using LOOKUP (2,1/ function in Google Sheets

Using function
=LOOKUP(2,1/((B8>=A1:A5)*(B8<=B1:B5)),C1:C5)
to lookup a value between two numbers doesn't seem to work in Google Sheets while in Excel it does. Does anyone know the alternative to this function in Google Sheets, please?
You need to use ARRAYFORMULA:
=ARRAYFORMULA(LOOKUP(2,1/((B8>=A1:A5)*(B8<=B1:B5)),C1:C5))

Get BTC prices on Google Sheets from Google Finance

I'm trying to get data from Google Finance in Google Sheets with this formula:
=GoogleFinance("CURRENCY:BTC")
But I'm getting this error:
GOOGLEFINANCE, the query for the symbol: 'CURRENCY:BTC' returned no data.
Although on Google Finance itself, I can get BTC prices:
https://www.google.com/finance?q=CURRENCY:BTC
with the same query strings.
How can I can fix this?
You need to have a from and to currency like this:
=GoogleFinance("CURRENCY:USDBTC")
For historic close price use:
=GoogleFinance("CURRENCY:USDBTC","close","07/07/2017")
If you want only the price returned use:
=iferror(index(GoogleFinance("CURRENCY:USDBTC","close","07/07/2017"),2,2))
As of 2020-08-15 the following formula works well (without any add-ons):
=GOOGLEFINANCE("BTCUSD")
Seems like it works only for BTC and ETH though.
2022-05-04, the following works on Google Sheets:
=googlefinance("CURRENCY:USDBTC") as well as most combinations of currency and BTC (and ETH, LTC, BNB, XRP, XLM, and ADA), for example GBPBTC and JPYBTC.
=googlefinance("CURRENCY:BTCUSD") works too, in the same combinations of coin and currency.
Although finance.google.com has DOGE and LINK pricing, they don't seem to work the same way in the Sheet's googlefinance function.
Another way to work with crypto currency is to use the add-on where you can extract data from other sources.
=CRYPTOFINANCE("BTCUSD")
Link below:
https://jbuty.com/how-to-get-crypto-currencies-rates-and-more-in-google-sheet-1a57e571bc14

Resources