Trying to get the results of a form using R, this method used to work with the previous url: https://ec.europa.eu/taxation_customs/vies/viesquer.do
Here for VAT number FR23489967794
.
library(rvest)
library(httr)
headers = c(
"User-Agent" = "Safari/537.36",
"Accept" = "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9"
)
params = list(
"ms" = "FR",
"iso" = "FR",
"vat" = "23489967794",
"name" = "",
"companyType" = "",
"street1" = "",
"postcode" = "",
"city" = "",
"requesterMs" = "FR",
"requesterIso" = "FR",
"requesterVat" = "23489967794",
"BtnSubmitVat" = "Verify"
)
r <- httr::GET(url = "https://ec.europa.eu/taxation_customs/vies/viesquer.do", httr::add_headers(.headers=headers), query = params)
r |> content() |> html_element('.validStyle') |> html_text()
However, now that they changed their URL to https://ec.europa.eu/taxation_customs/vies/#/vat-validation, I am not able to get this to work (no .validStyle
element in the response), any help much appreciated.