Scraping with R-xpathSApply returning a list of 0

I am learning to read XML data in R.

I wanted to extract the information of Brazilian football (name of the championship, principal of the game, result, etc.) of this site: https://www.terra.com.br/esportes/equipes/sao-paulo/lista-de-jogos with the XML package. My code looked like this:

[1] fileUrl <- 'http://www.terra.com.br/esportes/equipes/sao-paulo/lista-de-jogos'
[2] doc <- htmlTreeParse(fileUrl, useInternalNodes = T)
[3] championship <- xpathSApply(doc,"//h3[@class='header-matches']", xmlValue)

However, the xpathsapply function ends up returning me a list of 0. Does anyone know why?

I tested the code on the Globo Esporte website and had success, I imagine it has to do with the XML code itself of the Terra website.

Author: D Bertuzzi, 2017-11-02