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

Received error in TableauScraper.loads() method when scraping public tableau site #30

Closed Kevinoh47 closed 2 years ago

Kevinoh47 commented 2 years ago

code:

url = "https://covid.cdc.gov/covid-data-tracker/#nationwide-blood-donor-seroprevalence"
ts = TS()
ts.loads(url)

error:

File "/usr/local/lib/python3.9/site-packages/tableauscraper/TableauScraper.py", line 78, in loads
    soup.find("textarea", {"id": "tsConfigContainer"}).text
AttributeError: 'NoneType' object has no attribute 'text'

Thanks!

bertrandmartel commented 2 years ago

@Kevinoh47 The Tableau url is https://public.tableau.com/views/MASS-DSerologyStudy/SeroprevalenceDashboardRegion4 . You can find it using the network tabs in Chrome development console

from tableauscraper import TableauScraper as TS

url = "https://public.tableau.com/views/MASS-DSerologyStudy/SeroprevalenceDashboardRegion4"
ts = TS()
ts.loads(url)

print(ts.getWorkbook().getWorksheetNames())
Kevinoh47 commented 2 years ago

oh wow ... thank you (and apologies for randomizing you!)