Advertisement
askanton

SkillBox

Jun 12th, 2020
285
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.68 KB | None | 0 0
  1. import requests
  2. import datetime
  3.  
  4. adresses = ['https://rage.mp', 'https://pypi.org', 'https://forum.pticevod.com/gusi-f5.html',
  5.             'http://domcorova.ru''https://wotspeak.org/mods/']
  6.  
  7.  
  8. def recuest(address, count):
  9.     print(f'{count} запросов по адресу', address)
  10.     print('время начала', datetime.datetime.now())
  11.     for i in range(count):
  12.         time = datetime.datetime.now()
  13.         response = requests.get(address)
  14.         time = datetime.datetime.now() - time
  15.         print(str(i).ljust(5), response.status_code, time)
  16.     print('время окончания:', datetime.datetime.now())
  17.  
  18.  
  19. for address in adresses:
  20.     recuest(address, 200)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement