code: def clean_url(url, replacement='_'):
          
          cleaned = re.sub(r'/$', '', re.sub(r'https?://', '', url))
          for character in '/ _ ? & : ; %'.split():
              cleaned = cleaned.replace(character, replacement)
          return cleaned
docs: Cleans the url for protocol prefix and trailing slash and replaces special characters
          with the given replacement.
  
          :param url: The url of the request.
          :param replacement: A string that is used to replace special characters.