import urllib2
page = urllib2.urlopen('http://127.0.0.1:5000/')
page_content = page.read()
with open('index.html', 'w') as fid:
fid.write(page_content)
I have tried numerous things to get the code to run again after so many seconds but everything I try gives me errors(windows user)
import urllib2
import time
def executeSomething():
page = urllib2.urlopen('127.0.0.1:5000/')
page_content = page.read() with open('index.html', 'w') as fid:
fid.write(page_content)
time.sleep(60)
while True:
executeSomething()