S
S
Sergey2018-06-17 23:36:28
Python
Sergey, 2018-06-17 23:36:28

Request every 2 seconds for a minute?

Hello. The question may be stupid, but it is, I just can not find a solution. How to implement the ability to send a request every two seconds for a minute and receive a response?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Mikhail, 2018-06-18
@Don53_Empire

import requests
import time

for i in range(30):
    r = requests.get("http://google.com")
    print(r)
    time.sleep(2)

It seems to be so :)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question