Advertisement
Guest User

Untitled

a guest
Nov 15th, 2019
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. with open('SoftBall.csv') as csvfile:
  2. readCSV = csv.reader(csvfile, delimiter=',')
  3. index = 0
  4. for row in readCSV:
  5. index += 1
  6. if index < 0:
  7. continue
  8. data = row[3]
  9. if len(data) < 40:
  10. continue
  11. data = json.loads(data)
  12. link = data["objects"][0]["instanceURI"]
  13. print(link)
  14. mask_name = row[9].split('.')[0]
  15. opener = urllib.request.build_opener()
  16. opener.addheaders = [('User-agent', 'Mozilla/5.0')]
  17. urllib.request.install_opener(opener)
  18. urllib.request.urlretrieve(link, "BallReadSoftserveMask/{}.png".format(mask_name))
  19. print(index)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement