Skip to content

Instantly share code, notes, and snippets.

@mactkg
Created April 23, 2011 06:38
Show Gist options
  • Save mactkg/938409 to your computer and use it in GitHub Desktop.
Save mactkg/938409 to your computer and use it in GitHub Desktop.
hoge.py
import time, urllib
end = 0
for i in range(5):
url = "http://www.switch-science.com/products/detail.php?product_id=" + str(i)
time.sleep(1)
if(url != IOError):
f = urllib.urlopen(url)
print str(i) + ":read"
continue
end = end + 1
if(end > 2):
break
print str(i) + ":404 Not found"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment