while True:
i += 1
if not urlfetch('http://news.ycombinator.com/comments?id=%d' % i):
break
# implementaton of urlfetch() left as an exercise to the reader