tableau-scraping icon indicating copy to clipboard operation
tableau-scraping copied to clipboard

Attempting to fetch data from sheet but can't get worksheets using getWorksheets(), most requests are returning empty arrays.

Open MahmoudThePeltist opened this issue 2 years ago • 0 comments

I'm trying to scrape data from this tableau: https://public.tableau.com/app/profile/salma1413/viz/MOP_2021_v1/MOP

However I can't seem to be able to get any information at all from any of the methods except for workbook.getSheets() which does return a list of objects that have the sheet name and the windowId though I'm still unsure of what to do next with this info.

from tableauscraper import TableauScraper as TS

url = "https://public.tableau.com/views/MOP_2021_v1/MOP"

ts = TS()
ts.loads(url)
workbook = ts.getWorkbook()

# ⚠ This is returning empty arrays [] []
wsNames = workbook.getWorksheetNames()
wss = workbook.getWorksheets()
print(wsNames, wss)

# This is returning a list of objects with IDs and names
sheetsList = workbook.getSheets()

for sheetDict in sheetsList:
    print(f"sheet : {sheetDict['sheet']} - {sheetDict['windowId']}") 
   
    ws = workbook.getWorksheet(sheetDict['sheet'])

    # ⚠ This is unfortunately returning an empty array as well  -> []
    filters = ws.getFilters()
    print("worksheet filters: ", filters) 
    

MahmoudThePeltist avatar Jun 24 '22 18:06 MahmoudThePeltist