code: def waitForURL(url, max_seconds=None):
      
  
      startTime = datetime.now()
      while True:
          response = None
          try:
              response = urllib2.urlopen(HEADREQUEST(url))
          except urllib2.URLError:
              pass
          if response is not None and isinstance(response, urllib2.addinfourl):
              if response.getcode() == 200:
                  # We're done, yay!
                  return
          timeNow = datetime.now()
          timePassed = timeNow - startTime
          if max_seconds and max_seconds < timePassed.seconds:
              return
          print("Waiting on URL %s for %s so far" % (url, timePassed))
          time.sleep(30)
docs: Give it a URL.  Keep trying to get a HEAD request from it until it works.
      If it doesn't work, wait a while and try again