Last active
April 17, 2018 03:36
-
-
Save jaredbriskman/6be8cb27c3dd495513b8a01aad099d18 to your computer and use it in GitHub Desktop.
Uber-quick literally never run webscraper code
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 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