jestebango / uoc

Prácticas de WEB SCRAPING de la asignatura TIPOLOGÍA DE DATOS
1 stars 2 forks source link

Datos de facturación de las empresas #8

Closed srodriguezcep closed 6 years ago

srodriguezcep commented 6 years ago

Mediante el siguiente código en R nos daría la información de la facturación de las empresas.

extraigo los resultados de la tabla install.packages("xml2") library("xml2") library("rvest") url.facturacion<- "xxxxxxxxxxxxxxxxxxxxxxxx" tabla_temp_fact<- read_html(url.facturacion) tabla_temp_fact<- html_nodes(tabla_temp_fact, "table") tabla_temp_fact length(tabla_temp_fact) sapply(tabla_temp_fact,class) html_table(tabla_temp_fact,fill=TRUE)

sapply(tabla_temp, function(x) dim(html_table(x, header=false, fill = TRUE)))

facturacion<- html_table(tabla_temp_fact,fill=TRUE) facturacion write.csv(facturacion, file="facturacion.csv") #guardamos en un archivo CSV.