code: def try_parse_url(url):
      
      if len(url.strip()) < 4:
          logger.info('URL too short: {}'.format(url))
          return None
      try:
          parsed_url = urlparse(url)
      except ValueError:
          logger.info('Parse URL ValueError: {}'.format(url))
          return None
      if parsed_url.scheme:
          return parsed_url
      try:
          parsed_url = urlparse('http://' + parsed_url.geturl())
      except ValueError:
          logger.info('Invalid URL for assumed http scheme: urlparse("{}") from "{}" '.format('http://' + parsed_url.geturl(), url))
          return None
      if not parsed_url.scheme:
          logger.info('Unable to guess a scheme for URL: {}'.format(url))
          return None
      return parsed_url
docs: User urlparse to try to parse URL returning None on exception