def select_best_url(self):
    best_url = self.parsed_urls[0]
    try:
      yield best_url
    except Exception:
      self.unsuccessful_calls[best_url] += 1
      if self.unsuccessful_calls[best_url] > self.max_failures:
        self.parsed_urls.rotate(-1)
        self.unsuccessful_calls[best_url] = 0
      raise
    else:
      self.unsuccessful_calls[best_url] = 0