library(XML)
library(RCurl)
url <- getURL("https://www.nationsonline.org/oneworld/countries_of_the_world.htm")
df <- readHTMLTable(url, header = T)
countries <- c(levels(df[[1]]$V2),levels(df[[2]]$V2),levels(df[[3]]$V2),
               levels(df[[4]]$V2),levels(df[[5]]$V2))
grep("\'", countries, value = TRUE)


  url <- getURL("https://en.wikipedia.org/wiki/List_of_culinary_fruits")
  df <- readHTMLTable(url, header = T)
  fruits <- c(levels(df[[1]]$`Common name`),
              levels(df[[2]]$`Common name`),
              levels(df[[3]]$`Common name`),
              levels(df[[4]]$`Common name`),
              levels(df[[5]]$`Common name`),
              levels(df[[6]]$`Common name`),
              levels(df[[7]]$`Common name`),
              levels(df[[8]]$`Common name`))
  pattern <- "(..)\\1"
  str_subset(fruits, pattern)
  
url <- getURL("https://www.idescat.cat/pub/?geo=mun%3A250387&id=pmh&n=8284#Plegable=geo")
df <- readHTMLTable(url, header = T) 
aa <- df$`\nPoblació. Per lloc de naixement i sexe\nAitona. 2018\n`
aa[,1]
