-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
scraping workbook, NOT worksheet with selectables #62
Comments
@federicoscabbia I have the same problem. I wrote this code to get around it.
|
@djay This is perfect, can you help me with this? I tried your function but I think I am using it wrong
|
I haven't tried it yet but I think you can actually pick any reandom worksheet and do serFilter with dashboardFilter=True and check=False |
For my function you pass None for worksheet name to use global filter
…On Wed, 12 Oct 2022, 6:25 pm david-hammond, ***@***.***> wrote:
@djay <https://github.com/djay> This is perfect, can you provide a
working example for this site?
from tableauscraper import TableauScraper as TS
import pandas as pd
url = "https://public.tableau.com/views/DashboardRegional_15811027307400/DashboardRegional?:embed=y&:showVizHome=no&:host_url=https%3A%2F%2Fpublic.tableau.com%2F&:embed_code_version=3&:tabs=no&:toolbar=no&:animate_transition=yes&:display_static_image=no&:display_spinner=no&:display_overlay=yes&:display_count=yes&publish=yes&:loadOrderID=0"
ts = TS()
ts.loads(url)
wb=ts.getWorkbook()
sheetName = "Mapa"
#I tried this using your function
wb = force_setFilter(wb, "Mapa", "Sexo", "Hombre")
ws = wb.getWorksheet(sheetName)
—
Reply to this email directly, view it on GitHub
<#62 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAKFZDZESLN4DVL3OYND6TWC2NZJANCNFSM5VNRRVEQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
@djay Brilliant, got it working, thanks so much! |
Did anyone try this solution on the tableau from the original question by @federicoscabbia ? |
Hi everyone,
I think i have found a tableau that has selectables not in the specific worksheet but in the workbook instead and i do not know how to scrape all the years. I tried this code to select the different years but when i look for the filters it gives back an empty list. Probably the the filtes are set at the workbook level and not at the worksheet level, however 'TableauWorkbook' object has no attribute 'getFilters'.
Could you please help me with that?
This is the table i'm referring to: https://public.tableau.com/views/SocialistPartyScandinavianFederation/Story1
And this is the code I used to scrape the data (as you can see i can only scrape the data from 1916 as it is set as the default year in the table).
The text was updated successfully, but these errors were encountered: