Created
December 16, 2021 19:28
-
-
Save vincentdavis/7fe068fabe2b8b36349ea89bdc768b51 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
from requests_html import HTMLSession | |
import pandas as pd | |
mainpage = "https://covid19.colorado.gov/covid19-outbreak-data" | |
try: | |
session = HTMLSession() | |
response = session.get(mainpage) | |
except: | |
print('failed to load main page') | |
links = response.html.absolute_links | |
for l in links: | |
if "covid-19_ob_weekly_report" in l: | |
print(l) | |
url = l | |
df = pd.read_excel(url) | |
print(df.head()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment