Ir al contenido

After scraping data with scrape_catastro is obtained an object of class catastro which is a list with at least two elements (parcelas and inmuebles). With this function that information can be translated into a tibble: both the parcelas and inmuebles as well as both

Uso

extract_from_catastro(list_scrape, which = c("parcelas", "inmuebles"))

Argumentos

list_scrape

A catastro object (the output of scrape_catastro).

which

Options: 'parcelas', 'inmuebles' or c('parcelas','inmuebles').

Valor

A tibble with the specified information.

Ejemplos


# Real example

urls <- c("https://www1.sedecatastro.gob.es/CYCBienInmueble/OVCListaBienes.aspx?rc1=9797905&rc2=VK3799F",
          "https://www1.sedecatastro.gob.es/CYCBienInmueble/OVCListaBienes.aspx?rc1=2831834&rc2=VK4723B")

address <- c('CL ARMENTEROS 44','CL ABTAO 30')

# web scraping:
example_catastro <- scrape_catastro(urls,address)
#> Error in scrape_catastro(urls, address): rvest and dplyr packages must be loaded

# extract information:

extract_from_catastro(example_catastro, which = 'inmuebles')
#> Error in extract_from_catastro(example_catastro, which = "inmuebles"): objeto 'example_catastro' no encontrado

extract_from_catastro(example_catastro, which = 'parcelas')
#> Error in extract_from_catastro(example_catastro, which = "parcelas"): objeto 'example_catastro' no encontrado

extract_from_catastro(example_catastro, c('inmuebles','parcelas'))
#> Error in extract_from_catastro(example_catastro, c("inmuebles", "parcelas")): objeto 'example_catastro' no encontrado