Last active
March 13, 2019 01:52
-
-
Save granttremblay/7fef5a1c00334a544d341b05f7e7e08b to your computer and use it in GitHub Desktop.
Download all Astro2020 Whitepaper PDFs
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
#!/usr/bin/env/python | |
import requests | |
from astropy.io import ascii | |
table = ascii.read('all_astro2020_whitepapers.csv') | |
numbers = table['Response ID'] | |
people = table['Last Name:Principal Author'] | |
urls = table['1:Upload File'] | |
for number, person, url in zip(numbers, people, urls): | |
try: | |
pdf = requests.get(url, allow_redirects=True) | |
open('{}_{}.pdf'.format(number,person), 'wb').write(pdf.content) | |
print('Downloaded {}_{}.pdf'.format(number,person)) | |
except: | |
print('ERROR downloading {}'.format(url)) | |
print('Done') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment