Comments (4)
There seems to be an issue with the drill down itself. I ran the template and it through a KeyError.
from tableauscraper import TableauScraper as TS
url = 'https://tableau.azdhs.gov/views/ELR/TestsConducted?%3Aembed=y&'
ts = TS()
ts.loads(url)
wb = ts.getWorkbook()
sheetName = "P1 - Tests by Day W/ % Positivity (Both)"
drillDown1 = wb.getWorksheet(sheetName).levelDrill(drillDown=True, position=1)
drillDown2 = drillDown1.getWorksheet(sheetName).levelDrill(drillDown=True, position=1)
drillDown3 = drillDown2.getWorksheet(sheetName).levelDrill(drillDown=True, position=1)
print(drillDown1.getWorksheet(sheetName).data)
print(drillDown2.getWorksheet(sheetName).data)
print(drillDown3.getWorksheet(sheetName).data)
from tableau-scraping.
@az-data-guru You can get the correct data by dropping position=1
since it seems the position is now set to 0
(the default)
from tableau-scraping.
I've fixed the key error in any case
The following gets the data:
from tableauscraper import TableauScraper as TS
url = 'https://tableau.azdhs.gov/views/ELR/TestsConducted?%3Aembed=y&'
ts = TS()
ts.loads(url)
wb = ts.getWorkbook()
sheetName = "P1 - Tests by Day W/ % Positivity (Both)"
drillDown1 = wb.getWorksheet(sheetName).levelDrill(drillDown=True)
print(drillDown1.getWorksheet(sheetName).data["MONTH(Collection Date)-alias"])
drillDown2 = drillDown1.getWorksheet(sheetName).levelDrill(drillDown=True)
print(drillDown2.getWorksheet(
sheetName).data["QUARTER(Collection Date)-alias"])
drillDown3 = drillDown2.getWorksheet(sheetName).levelDrill(drillDown=True)
print(drillDown3.getWorksheet(sheetName).data["YEAR(Collection Date)-alias"])
The problem is that the workbook doesn't retain the data so you can get the data between calls, you can get around this for now. I'm working on it
from tableau-scraping.
@az-data-guru I've fixed the getWorksheet
and getWorksheets
in the latest release.
Also since last week, the zones are stored in the scraper object, it means than you don't have to pass the last workbook to the next call anymore, since it's shared
For example:
from tableauscraper import TableauScraper as TS
url = 'https://tableau.azdhs.gov/views/ELR/TestsConducted?%3Aembed=y&'
ts = TS()
ts.loads(url)
sheetName = "P1 - Tests by Day W/ % Positivity (Both)"
ws = ts.getWorkbook().getWorksheet(sheetName)
drillDown1 = ws.levelDrill(drillDown=True)
drillDown2 = ws.levelDrill(drillDown=True)
drillDown3 = ws.levelDrill(drillDown=True)
print(drillDown1.getWorksheet(sheetName).data)
print(drillDown2.getWorksheet(sheetName).data)
print(drillDown3.getWorksheet(sheetName).data)
https://replit.com/@bertrandmartel/TableauCovidAZDHSTests
from tableau-scraping.
Related Issues (20)
- Can't set a filter to a value thats not in the defined list for that filter HOT 2
- add missing method for command `select-region-no-return-server` HOT 1
- Add getFilterItems() method
- Scraping tableau data based on data filtered with dropdown boxes in non existent worksheet columns
- Adding range filters
- soup.find fails to find Tableau data HOT 3
- Scraping from a private-access dashboard
- scraping workbook, NOT worksheet with selectables HOT 6
- Attempting to fetch data from sheet but can't get worksheets using getWorksheets(), most requests are returning empty arrays.
- Zones don't always update when there are story points
- getFilters() only returns the first 200 values
- How to scrape pagination data
- Radio Button filtering does not work
- Warning: mixed data types
- Add support for the 'Choose a format to download' > 'Data' option (alongside the crosstab option)
- Issue w/ filtering and parameters/selectable items HOT 1
- Setting a filter produces `WARNING - no data dictionary present in response` and causes `getCsvData` to raise `TypeError`
- README example does not work anymore. HOT 4
- setFilter() not working
- proxy auth
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tableau-scraping.