I have a list of UPCs stored in a .csv that I am trying to search the iTunes API with. The search result is to be saved, ideally in a file named after the UPC. So far I have this, I am able to get a single search result to download but it stops after the first search.
- Code: Select all
with open('upc.csv', newline='') as f:
reader = csv.reader(f)
for row in reader:
s = urllib.request.urlretrieve("https://itunes.apple.com/lookup?upc="+'row',"hold")
Any input on how to get the script fully functioning? Here's a list of sample UPCs.
(There are quite a few more)