bertrandmartel / tableau-scraping

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

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

Open MahmoudThePeltist opened 2 years ago

MahmoudThePeltist commented 2 years ago

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)