嗨我想知道我是否可以让python脚本停留在被询问的网页上几秒钟,然后关闭与我尝试的网页的连接但是一旦响应进来就断开连接
import urllib3
http = urllib3.PoolManager()
r = http.request('GET', 'http://example.com/')
i = 0
while i <= 300 :
i = i + 1
time.sleep(7)
print (i);
time.sleep(3)
if i == 300 :
break