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)
我尝试了很多方法让代码在这么多秒后再次运行,但每次尝试都会出错(windows用户)
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()
使用^{} :
相关问题 更多 >
编程相关推荐