It is probably because the site you are trying to reach has a request limit for security reasons. For example, if you use the Reddit API, you are only allowed to do one request every two seconds if I remember correctly. You could maybe investigate the rules at the Google Colab API and see if it mentions this.
You could try to make an exception handling on HTTPError and make your program sleep for a number of seconds before requesting again.
Maybe these links are helpful:
  
      

      Google Cloud
  

  
    

API rate limits  |  Compute Engine Documentation  | ... 24



  

  
    
    
  

  


  

      en.wikipedia.org
  

  
    

HTTP 403 5

The HTTP 403 is an HTTP status code meaning access to the requested resource is forbidden. The server understood the request, but will not fulfill it.
 HTTP 403 provides a distinct error case from HTTP 401; while HTTP 401 is returned when the client has not authenticated, and implies that a successful response may be returned following valid authentication, HTTP 403 is returned when the client is not permitted access to the resource despite providing authentication such as insufficient permission...