Skip to content

Instantly share code, notes, and snippets.

@yaojialyu
Created November 6, 2012 04:10
Show Gist options
  • Save yaojialyu/4022485 to your computer and use it in GitHub Desktop.
Save yaojialyu/4022485 to your computer and use it in GitHub Desktop.
import urllib2
import time
def main():
opener = urllib2.build_opener()
while 1:
request = urllib2.Request('http://xinhuanet.com/')
page = opener.open(request)
print page.code
print 'sleeping...'
time.sleep(60)
if __name__ == '__main__':
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment