Skip to content

Instantly share code, notes, and snippets.

@jaredbriskman
Last active April 17, 2018 03:36
Show Gist options
  • Save jaredbriskman/6be8cb27c3dd495513b8a01aad099d18 to your computer and use it in GitHub Desktop.
Save jaredbriskman/6be8cb27c3dd495513b8a01aad099d18 to your computer and use it in GitHub Desktop.
Uber-quick literally never run webscraper code
import wget
baseURL = "https://aqs.epa.gov/aqsweb/airdata/daily"
directory = "/home/something/Downloads/"
dtypes = {
"ozone":"_44201_",
"so2":"_42401_",
"co2":"_42101_",
"no2":"_42602_",
}
names = [*dtypes] #ooh, fancy PEP 448 unpacking
dates = range(2010,2017)
for date in dates:
for name in names:
url = baseURL + dtypes[name] + str(date) + ".zip"
filename = directory + name + "_" + date
wget.download(url, out=filename)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment