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

Specific worksheets only? #4

Closed sidharthrajaram closed 3 years ago

sidharthrajaram commented 3 years ago

Hey @bertrandmartel , this is such an awesome library! Easy to use and super robust.

Quick question, are there any ways to only get a specific worksheet when getting a dashboard (rather than looking through dashboard.worksheets afterwards)?

bertrandmartel commented 3 years ago

@sidharthrajaram Hello, yes you can get the worksheet directly using getWorksheet("WORKSHEET_NAME") like :

from tableauscraper import TableauScraper as TS

url = "https://public.tableau.com/views/PlayerStats-Top5Leagues20192020/OnePlayerSummary"

ts = TS()
ts.loads(url)

worksheet = ts.getWorksheet("ATT MID CREATIVE COMP")
print(worksheet.data)
sidharthrajaram commented 3 years ago

Great, thanks.