flightsbr
flightsbr copied to clipboard
Function read_airfares() not working
The function read_airfares() currently not working because ANAC has changed the url address where the data files are stored.
In the recent past, fares data on domestic and international flights were stored in:
- https://sistemas.anac.gov.br/sas/tarifadomestica/
- https://sistemas.anac.gov.br/sas/tarifainternacional/
The data is now only available other webinterfaces which work with point and click:
- domestic: https://sas.anac.gov.br/sas/downloads/view/frmDownload.aspx?tema=14
- international: https://sas.anac.gov.br/sas/downloads/view/frmDownload.aspx?tema=17
However, haven't been able to extract from the new site the url to the data files:
base_url = 'https://sas.anac.gov.br/sas/downloads/view/frmDownload.aspx?tema=14'
h <- try(rvest::read_html(base_url), silent = TRUE)
# filter elements of basic data
elements <- rvest::html_elements(h, "a")
any help here would be much appreciated.
It seems ANAC has a data API we could use
- https://sistemas.anac.gov.br/dadosabertos/
- https://sistemas.anac.gov.br/dadosabertos/Operador%20Aeroportu%C3%A1rio/Tarifas%20Aeroportu%C3%A1rias%20Tetos%20Tarif%C3%A1rios%20e%20Reajustes%20Tarif%C3%A1rios/
This should be fixed in the next release.