input: Write a function to parse the given URL and return a tuple containing the protocol, domain name, and path. If the URL is invalid or cannot be parsed, return None.
  assert parse_url('https://www.example.com/path/to/file')==('https', 'www.example.com', '/path/to/file')
  assert parse_url('http://invalid-url')==None
  assert parse_url('ftp://ftp.example.com/dir')==('ftp', 'ftp.example.com', '/dir')
  assert parse_url('')==None
  assert parse_url('https://www.example.com')==('https', 'www.example.com', '')
output: def parse_url(url):
      try:
          parsed_url = urlparse(url)
          if not parsed_url.scheme or not parsed_url.netloc:
              return None
          return (parsed_url.scheme, parsed_url.netloc, parsed_url.path)
      except:
          return None