uisng xpath, several paths can be combined with | delimiter. Therefore, I use it to get tournaments and stores on the same list. Then I get the second list of competitions. I use the last list to smash the first
url<-"http://en.wikipedia.org/wiki/List_of_department_stores_by_country" library(XML) xmltext <- htmlTreeParse(url, useInternalNodes = T)
Now I'm doing some processing to split cont.shops using countries.
dd <- which(cont.shops %in% contries)
I can check the result:
> ll[[contries[1]]] [1] "[edit] ร Tunisia" "Magasin Gรฦรยฉnรฦรยฉral" "Mercure Market" "Promogro" "Geant" [6] "Carrefour" "Monoprix" > ll[[contries[2]]] [1] "[edit] ร Morocco" [2] "Alpha 55, one 6-story store in Casablanca" [3] "Galeries Lafayette, to open in 2011[1] within Morocco Mall, in Casablanca"
source share