bertrandmartel / tableau-scraping

Tableau scraper python library. R and Python scripts to scrape data from Tableau viz
MIT License
131 stars 21 forks source link

Get selectable items from storypoints items in command response #35

Closed bertrandmartel closed 3 years ago

bertrandmartel commented 3 years ago

Storypoints items are not parsed when getting selectable items from a command response

Example:

from tableauscraper import TableauScraper as TS

url = 'https://tableau.ons.org.br/t/ONS_Publico/views/DemandaMxima/HistricoDemandaMxima'
ts = TS()
ts.loads(url)

wb = ts.getWorkbook()
print(wb.getParameters())
ws = wb.getWorksheet("Simples Demanda Máxima Semana Dia")

# Set units
wb = wb.setParameter("Selecione DM Simp 4", "Demanda Máxima Instântanea (MW)")

# Set to daily resolution
wb = wb.setParameter("Escala de Tempo DM Simp 4", "Dia")

# # Set the start date
wb = wb.setParameter("Início Primeiro Período DM Simp 4", "01/01/2017")

# Set the end date
wb = wb.setParameter("Fim Primeiro Período DM Simp 4", "31/12/2017")

# Retrieve daily worksheet
ws = wb.getWorksheet("Simples Demanda Máxima Semana Dia")

print(ws.data[['Data Escala de Tempo 1 DM Simp 4-value',
               'SOMA(Selecione Tipo de DM Simp 4)-value', 'ATRIB(Subsistema)-alias']])

print(ws.getSelectableItems())