Advertisement
Guest User

Untitled

a guest
Sep 29th, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. import json
  2. import requests
  3.  
  4.  
  5.  
  6.  
  7. x = 1
  8. while x < 3000:
  9.  
  10. f = open('newlist.csv')
  11.  
  12. lines = f.readlines()
  13. print (lines[0])
  14. i = 0
  15. while i < 1161:
  16.  
  17. url = "https://api.iextrading.com/1.0/stock/%s/chart/1d' %lines
  18. response = requests.get(url)
  19. todos = json.loads(response.text)
  20. time.sleep(1)
  21. print (todos[0]['open'])
  22. print (todos[1]['open'])
  23. print (todos[3]['open'])
  24. break
  25. i = i+1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement