Last active
July 26, 2019 05:47
-
-
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.
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
id | query | |
---|---|---|
48843 | this is a sample query | |
3894 | also a sample query | |
9349589 | so on and so forth |
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 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