Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import requests
- import json
- import time
- from datetime import datetime
- with open('urls.json', 'r') as f:
- urls = json.loads(f.read())
- start = int(time.time())
- for counter, url in enumerate(urls):
- r = requests.get(url['url'])
- mystring = '{}. {}: {}'.format(counter + 1, url['title'], r.status_code)
- print(mystring)
- end = int(time.time())
- print('took time: {} seconds'.format(int(end - start)))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement