#!/usr/bin/env python
import urllib
import time
url = urllib.URLopener()
resp = url.open('http://icanhazip.com')
html = resp.read()
print html
time.sleep(5)
Понимаю что все крутится вокруг цикла while но что то не могу распарсить каким образом.
#!/usr/bin/env python
import urllib
import time
url = urllib.URLopener()
resp = url.open('http://icanhazip.com')
html = resp.read()
print html
time.sleep(5)
#!/usr/bin/env python
import urllib
import time
while True:
url = urllib.URLopener()
resp = url.open('http://icanhazip.com')
html = resp.read()
print html
time.sleep(5)