Skip to content

Instantly share code, notes, and snippets.

@rvvvt
Last active July 26, 2019 05:47
Show Gist options
  • Save rvvvt/54d63cd0a3347722b0d4583d29c92a8d to your computer and use it in GitHub Desktop.
Save rvvvt/54d63cd0a3347722b0d4583d29c92a8d to your computer and use it in GitHub Desktop.
Pull one named column from a CSV file with multiple columns and puts it into a list.
id query
48843 this is a sample query
3894 also a sample query
9349589 so on and so forth
import csv
urls = []
def urls_to_list():
with open('100.csv') as csvfile:
reader = csv.DictReader(csvfile)
for row in reader:
# print(row['query'])
# r = requests.get(row['query'])
url = row['query']
urls.append(url)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment