This is a follow-up question to How to scrape a public tableau dashboard? and the use of the impressive Tableau scraper library. The library has the ability to select an item in a worksheet, however it fails to recognize the requested value.
The tableau dashboard is here: https://tableau.ons.org.br/t/ONS_Publico/views/DemandaMxima/HistricoDemandaMxima?:embed=y&:display_count=y&:showAppBanner=true&:showVizHome=y
And my code is:
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()
# Set units
wb.setParameter("Selecione DM Simp 4", "Demanda Máxima Instântanea (MW)")
# Set to daily resolution
wb.setParameter("Escala de Tempo DM Simp 4", "Dia")
# Set the start date
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","12/31/2017")
# Retrieve daily worksheet
ws = wb.getWorksheet("Simples Demanda Máxima Semana Dia")
# Select subsystem
ws.select("ATRIB(Subsistema)", "Norte")
(This is where I am warned "tableauScraper - ERROR - 'Norte' is not in list")
# show data
print(ws.data)
# export data
ws.data.to_csv('C:\Temp\Data.csv')
Any help would be appreciated.