#!/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')