0

I want to get the rate of the euro from this website: bonbast.com. I tried this formula:

IMPORTXML("https://www.bonbast.com/","//tr[@id='eur1']")

but nothing imported. What is wrong with it?

RavinderSingh13
  • 130,504
  • 14
  • 57
  • 93
  • 1
    The value is dynamic. You can get it if you make a POST-request to the same "https://www.bonbast.com" address but with form-data and cookies. The response of XHR will be the JSON where you can find required data like `eur1: "32080"` – JaSON Aug 12 '22 at 13:16

1 Answers1

1

As mentioned in JaSON's comment, the IMPORTXML function cannot read dynamic values generated after the page loads. It's just meant to read static pages.

The website bonbast.com seems to have an API so you can use that to retrieve the data, though it's a paid service.

By default Sheets is not really equipped to scrape dynamic websites. You're better off looking for another site that has static data, look for some kind of extension or add-on that does the work for you or learn more advanced scraping approaches.

Daniel
  • 3,157
  • 2
  • 7
  • 15