library(rvest)
suppressPackageStartupMessages(library(dplyr))
url <- "http://madb.europa.eu/"
# r <- html("http://madb.europa.eu/madb/atDutyOverviewPubli.htm?option=1&display=20&language=all&year1=&year2=§or=all&country=all&langId=en&datacat_id=AT&showregimes=&countryid=US&submit=Search&countries=US&hscode=5515110045")
r <- html(url,
path ="madb/atDutyOverviewPubli.htm",
query = list(option = 1,
display = 20,
language = "all",
year1 = "",
year2 = "",
sector = "all",
country = "all",
langId = "en",
datacat_id = "AT",
showregimes = "",
countryid = "US",
submit = "Search",
countries = "US",
hscode= "01012000"))
html_nodes(r,, "//table[1]") %>% html_table(fill = T, header = T) %>%
as.data.frame(stringsAsFactors = F) %>%
select(hs = 1, desc = 2)
## hs desc
## 1 <NA> <NA>
## 2 01 CHAPTER 1 LIVE ANIMALS
## 3 0101 Live horses, asses, mules and hinnies:
## 4 - Horses:
## 5 0101.21 - - Pure-bred breeding animals:
## 6 0101.21.00.10 - - - Male
## 7 0101.21.00.20 - - - Female
## 8 0101.29 - - Other:
## 9 0101.29.00.10 - - - Imported for immediate slaughter
## 10 0101.29.00.90 - - - Other
## 11 0101.30 - Asses
## 12 0101.90 - Other:
## 13 0101.90.30 - - Imported for immediate slaughter
## 14 0101.90.40 - - Other