Skip to content

Instantly share code, notes, and snippets.

@vincentdavis
Created December 16, 2021 19:28
Show Gist options
  • Save vincentdavis/7fe068fabe2b8b36349ea89bdc768b51 to your computer and use it in GitHub Desktop.
Save vincentdavis/7fe068fabe2b8b36349ea89bdc768b51 to your computer and use it in GitHub Desktop.
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