I want to extract a table from web http://en.wikipedia.org/wiki/Brazil_national_football_team
library(XML)
baseURL <- "http://en.wikipedia.org/wiki/Brazil_national_football_team"
xmltext <- htmlParse(baseURL)
xmltable <- xpathApply(xmltext, "//table[.//tbody//tr//th//a[@title='CONCACAF Gold Cup']]")
Here is the xpath :"//table[.//tbody//tr//th//a[@title='CONCACAF Gold Cup']]"
neither
xmltable <- xpathApply(xmltext, "//table[.//tbody//tr//th//a[@title='CONCACAF Gold Cup']]")
nor
xmltable <- xpathApply(xmltext, "//table[//tbody//tr//th//a[@title='CONCACAF Gold Cup']]")
Can get the specified table. How can I write xpath expression?
Please see the attchment .