I am trying to do a Webscraping using R on the following Website https://www.ictax.admin.ch/extern/de.html#/ratelist/2022. I need the information in the following table Exchange rate table. It is my first webscraping so I am unsure if I do something wrong.
I am working on a company network since that seems to be a question that is often asked.
My first approach was to use the package rvest and the following code
url <-"https://www.ictax.admin.ch/extern/de.html#/ratelist/2022"
exchange_rates <- url%>% read_html()%>% html_nodes(xpath='//*[@id="exchangeRates"]/div/div[2]')
Unfortunatly this did not work
I did also try it several other ways
exchange_rates <- url%>% read_html()%>% html_nodes("table")
exchange_rates <- url%>% read_html()%>% html_nodes('#exchangeRates')
I alway get {xml_nodeset (0)}
Since I get {xml_nodeset (0)} no matter what i try. I concluded that the page dynamically loads content as described in [https://stackoverflow.com/questions/57547825/xml-nodeset-0-issue-when-webscraping-table]. I then tried the solution described there.
I found the following url in the network tab: https://www.ictax.admin.ch/extern/api/coreGadget/exchangeRates.json which seems to bring in the data but this url is not working. (I also found soulutions using the package V8. Because of company restiction it would be difficult for me to work with this package)
Does anyone know a way to get the data from this website usind R?