Read URL every 60 seconds in Python

0

I want this URL every 60 seconds, I have this code. The URL brings me data of actions

import requests
url="https:XXXXXXXXXXXXXXX"
r = requests.get(url)
text = r.text 
print (text)

How can I do a function to read it to me every 60 seconds?

    
asked by Napoleon Ricaurte 14.07.2018 в 17:07
source

1 answer

0

Use time. I hope it serves you

import requests,time
while True:
    url="https:XXXXXXXXXXXXXXX"
    r = requests.get(url)
    text = r.text 
    print (text)
    time.sleep(60)
    
answered by 14.07.2018 / 17:20
source