Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- with open('SoftBall.csv') as csvfile:
- readCSV = csv.reader(csvfile, delimiter=',')
- index = 0
- for row in readCSV:
- index += 1
- if index < 0:
- continue
- data = row[3]
- if len(data) < 40:
- continue
- data = json.loads(data)
- link = data["objects"][0]["instanceURI"]
- print(link)
- mask_name = row[9].split('.')[0]
- opener = urllib.request.build_opener()
- opener.addheaders = [('User-agent', 'Mozilla/5.0')]
- urllib.request.install_opener(opener)
- urllib.request.urlretrieve(link, "BallReadSoftserveMask/{}.png".format(mask_name))
- print(index)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement